Skip to content

Commit

Permalink
refactor(fe): ♻️ update next-auth options to use session strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
lehuygiang28 committed Jul 4, 2024
1 parent b749d50 commit fe340b2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apps/fe/src/libs/next-auth/options.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Account, Session, User } from 'next-auth';
import { Account, Session, User, AuthOptions } from 'next-auth';
import GoogleProvider from 'next-auth/providers/google';
import GithubProvider from 'next-auth/providers/github';
import CredentialsProvider from 'next-auth/providers/credentials';
import { AuthValidatePasswordlessDto, LoginResponseDto } from '~be/app/auth/dtos';
import { AxiosError } from 'axios';
import { axiosInstance } from '~/libs/axios';

export const authOptions = {
export const authOptions: AuthOptions = {
providers: [
GoogleProvider({
clientId: process.env.AUTH_GOOGLE_ID,
Expand Down Expand Up @@ -40,6 +40,7 @@ export const authOptions = {
}),
],
secret: process.env.NEXTAUTH_SECRET,
session: { strategy: 'jwt' },
callbacks: {
/**
* Controls whether a user is allowed to sign in or not.
Expand Down

0 comments on commit fe340b2

Please sign in to comment.