fix: cookies HTTP, logout route prefix, header logout method
This commit is contained in:
@@ -38,8 +38,8 @@ const routes = {
|
||||
},
|
||||
'session.destroy': {
|
||||
methods: ["POST"],
|
||||
pattern: '/logout',
|
||||
tokens: [{"old":"/logout","type":0,"val":"logout","end":""}],
|
||||
pattern: '/auth/logout',
|
||||
tokens: [{"old":"/auth/logout","type":0,"val":"auth","end":""},{"old":"/auth/logout","type":0,"val":"logout","end":""}],
|
||||
types: placeholder as Registry['session.destroy']['types'],
|
||||
},
|
||||
'computers.index': {
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ export interface Registry {
|
||||
}
|
||||
'session.destroy': {
|
||||
methods: ["POST"]
|
||||
pattern: '/logout'
|
||||
pattern: '/auth/logout'
|
||||
types: {
|
||||
body: {}
|
||||
paramsTuple: []
|
||||
|
||||
Vendored
+1
-1
@@ -32,10 +32,10 @@ declare module '@adonisjs/inertia/types' {
|
||||
'widgets/ComputerCard': ExtractProps<(typeof import('../../inertia/pages/widgets/ComputerCard.vue'))['default']>
|
||||
'widgets/ComputerComponentsTable': ExtractProps<(typeof import('../../inertia/pages/widgets/ComputerComponentsTable.vue'))['default']>
|
||||
'widgets/ComputersViewer': ExtractProps<(typeof import('../../inertia/pages/widgets/ComputersViewer.vue'))['default']>
|
||||
'widgets/CustomSelect': ExtractProps<(typeof import('../../inertia/pages/widgets/CustomSelect.vue'))['default']>
|
||||
'widgets/DeleteConfirmationModal': ExtractProps<(typeof import('../../inertia/pages/widgets/DeleteConfirmationModal.vue'))['default']>
|
||||
'widgets/SimpleGallery': ExtractProps<(typeof import('../../inertia/pages/widgets/SimpleGallery.vue'))['default']>
|
||||
'widgets/TableComponent': ExtractProps<(typeof import('../../inertia/pages/widgets/TableComponent.vue'))['default']>
|
||||
'widgets/ValidationError': ExtractProps<(typeof import('../../inertia/pages/widgets/ValidationError.vue'))['default']>
|
||||
'widgets/CustomSelect': ExtractProps<(typeof import('../../inertia/pages/widgets/CustomSelect.vue'))['default']>
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ export const http = defineConfig({
|
||||
/**
|
||||
* Send cookies only over HTTPS in production.
|
||||
*/
|
||||
secure: app.inProduction,
|
||||
secure: false,
|
||||
|
||||
/**
|
||||
* Cross-site policy for cookie sending.
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ const sessionConfig = defineConfig({
|
||||
/**
|
||||
* Send cookies only over HTTPS in production.
|
||||
*/
|
||||
secure: app.inProduction,
|
||||
secure: false,
|
||||
|
||||
/**
|
||||
* Cross-site policy for cookie sending.
|
||||
|
||||
@@ -80,6 +80,7 @@ const user = computed(() => {
|
||||
|
||||
<Link
|
||||
href="/auth/logout"
|
||||
method="post"
|
||||
class="flex items-center gap-3 px-4 py-2 text-body-sm font-body-sm text-on-surface hover:bg-surface-container-low transition-colors"
|
||||
>
|
||||
<span class="material-symbols-outlined text-[20px]">logout</span>
|
||||
|
||||
@@ -20,6 +20,7 @@ export default await Env.create(new URL('../', import.meta.url), {
|
||||
|
||||
// App
|
||||
APP_KEY: Env.schema.secret(),
|
||||
APP_URL: Env.schema.string(),
|
||||
|
||||
// Session
|
||||
SESSION_DRIVER: Env.schema.enum(['cookie', 'memory', 'database'] as const),
|
||||
|
||||
@@ -30,6 +30,7 @@ router
|
||||
.group(() => {
|
||||
router.post('logout', [controllers.Session, 'destroy'])
|
||||
})
|
||||
.prefix('/auth')
|
||||
.use(middleware.auth())
|
||||
|
||||
router
|
||||
|
||||
Reference in New Issue
Block a user