Next.js 14 Auth V5 : Configuring JWT Session Strategy with NextAuth | EzyCode

preview_player
Показать описание

🔐 Key Topics Covered:

1. Understanding the different session strategies in NextAuth.
2. Step-by-step guide to setting up JWT Session Strategy with NextAuth V5.
3. Fine-tuning session timeout periods to enhance security.
4. Practical examples demonstrating the implementation of JWT Session Strategy.

👨‍💻 Who should watch this video:

2. Those wanting to explore the advanced features of NextAuth V5.
3. Anyone interested in mastering JWT Session Strategy for secure user sessions.

#nextjs
#nextauth
#ezycode
#websecurity
#webdevelopment

Facebook Ezycode:
-------------

Facebook Chandra Mani:
-------------
Рекомендации по теме
Комментарии
Автор

Hi, I'm following your tutorial. Previously in version 4 of NextAuth, I did it like this:

async authorize(credentials) {
if (!credentials) {
return null;
}

const session = await AuthApiService.login(credentials.email, credentials.password);
if (session?.status == 401) {
return null;
} else {
cookies().set('next-auth.token', session.token, {
path: '/',
httpOnly: true,
sameSite: 'strict',
maxAge: parseInt(process.env.NEXTAUTH_EXPIRES_TOKEN, 10),
});
...
I used my own jwt token coming from my authorization server using Spring. And it took the token from the browser's token session to make the request, as every request requires a bearer token...

How would you do this using NextAuth v5? All requests require the jwt token issued by the authorization server.

Gustavo-fdst
Автор

Thank you for this. What if I want to use the refresh token to get new access token and update the maxage

TemmyCodingLifestyle