Relative Content

Tag Archive for typescriptnext.js

Where or how do i store JWT access token in a next.js app router app?

I’ve got a backend that uses a JWT auth, when i log in, it sends me access token in the body of the response and refresh token in http-only cookies. I get the part with the refresh-token, it’s attached on every request, fine, but what about access token. What’s the most convinient way to store it?

NextJs MetadataRoute.Sitemap does not contain definition for alternates

The problem I’m trying to generate a sitemap with hreflang links for alternative languages. The nextJs documentation (https://nextjs.org/docs/app/api-reference/file-conventions/metadata/sitemap#generate-a-localized-sitemap) advises to create a sitemap with alternate urls, ie hreflangs, like this: import { MetadataRoute } from ‘next’; export default function sitemap(): MetadataRoute.Sitemap { return [ { url: ‘https://example.com’, lastModified: new Date(), alternates: { languages: { es: […]

sitemap.xml not working after build in Next.js

I’m working on a Next.js project where I need to generate a sitemap using sitemap.xml. The sitemap works perfectly in development, but after building the project for production, the /sitemap.xml URL returns no data.