Skip to content

Commit

Permalink
Merge branch 'dev' into snyk-upgrade-28f4f59b2a4a63db69767cdf046b0279
Browse files Browse the repository at this point in the history
  • Loading branch information
angeloreale authored Aug 7, 2024
2 parents 340851f + d1bfbca commit 8a58a83
Show file tree
Hide file tree
Showing 10 changed files with 481 additions and 220 deletions.
19 changes: 14 additions & 5 deletions lib/auth/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {

export const GetSession = async ({ cookies = '' }) => {
try {
const response = await fetch(`${process.env.AUTH_URL}/api/auth/session`, {
const response = await fetch(`${process.env.AUTH_URL}/api/v1/auth/session`, {
method: 'GET',
headers: {
Accept: 'application/json',
Expand Down Expand Up @@ -137,7 +137,7 @@ export const authConfig = {
return true;
},
async redirect() {
return `${process.env.MAIN_URL}`;
return `${process.env.MAIN_URL}/dash`;
},
// async jwt({ user, token }) {
// if (user) {
Expand Down Expand Up @@ -180,13 +180,22 @@ export const authConfig = {
secure: true,
},
},
csrfToken: {
name: `authjs.csrf-token`,
options: {
httpOnly: true,
sameSite: 'none',
path: '/',
secure: true,
},
},
},
trustHost: true,
pages: {
signIn: '/signin',
signIn: '/dash/signin',
signOut: '/',
error: '/error', // Error code passed in query string as ?error=
verifyRequest: '/verify', // (used for check email message)
error: '/dash/error', // Error code passed in query string as ?error=
verifyRequest: '/dash/verify', // (used for check email message)
// newUser: '/' // New users will be directed here on first sign in (leave the property out if not of interest)
},
} satisfies NextAuthConfig;
Expand Down
2 changes: 1 addition & 1 deletion lib/state/providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function RootProviders({ children }: { children: React.ReactNode }) {
if (!authState?.initd) return;

return (
<SessionProvider basePath={base ? `${base}/api/auth` : '/api/auth'}>
<SessionProvider basePath={base ? `${base}/api/v1/auth` : '/api/v1/auth'}>
<AuthContext.Provider value={authState}>{children}</AuthContext.Provider>
</SessionProvider>
);
Expand Down
Empty file removed middleware.ts
Empty file.
Loading

0 comments on commit 8a58a83

Please sign in to comment.