Skip to content

Commit

Permalink
feat(session): updating to match criteria to be defined by the base a…
Browse files Browse the repository at this point in the history
…docasts site
  • Loading branch information
tomgobich committed Dec 22, 2024
1 parent c3d74c5 commit f4bc2bf
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/controllers/auth/login_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import app from '@adonisjs/core/services/app'
export default class LoginController {
async show({ inertia, response }: HttpContext) {
if (app.inProduction) {
return response.redirect('https://adocasts.com/login?return=cms')
return response.redirect('https://adocasts.com/signin?action=cms')
}

return inertia.render('auth/login')
Expand Down
6 changes: 3 additions & 3 deletions config/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ const authConfig = defineConfig({
default: 'web',
guards: {
web: sessionGuard({
useRememberMeTokens: false,
useRememberMeTokens: true,
provider: sessionUserProvider({
model: () => import('#models/user')
model: () => import('#models/user'),
}),
}),
},
Expand All @@ -25,4 +25,4 @@ declare module '@adonisjs/auth/types' {
}
declare module '@adonisjs/core/types' {
interface EventsList extends InferAuthEvents<Authenticators> {}
}
}
1 change: 1 addition & 0 deletions config/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const sessionConfig = defineConfig({
httpOnly: true,
secure: app.inProduction,
sameSite: 'lax',
domain: env.get('SESSION_DOMAIN'),
},

/**
Expand Down
1 change: 1 addition & 0 deletions start/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export default await Env.create(new URL('../', import.meta.url), {
|----------------------------------------------------------
*/
SESSION_DRIVER: Env.schema.enum(['cookie', 'memory'] as const),
SESSION_DOMAIN: Env.schema.string(),

/*
|----------------------------------------------------------
Expand Down

0 comments on commit f4bc2bf

Please sign in to comment.