fix: cookies HTTP, logout route prefix, header logout method
This commit is contained in:
@@ -38,8 +38,8 @@ const routes = {
|
|||||||
},
|
},
|
||||||
'session.destroy': {
|
'session.destroy': {
|
||||||
methods: ["POST"],
|
methods: ["POST"],
|
||||||
pattern: '/logout',
|
pattern: '/auth/logout',
|
||||||
tokens: [{"old":"/logout","type":0,"val":"logout","end":""}],
|
tokens: [{"old":"/auth/logout","type":0,"val":"auth","end":""},{"old":"/auth/logout","type":0,"val":"logout","end":""}],
|
||||||
types: placeholder as Registry['session.destroy']['types'],
|
types: placeholder as Registry['session.destroy']['types'],
|
||||||
},
|
},
|
||||||
'computers.index': {
|
'computers.index': {
|
||||||
|
|||||||
+1
-1
@@ -69,7 +69,7 @@ export interface Registry {
|
|||||||
}
|
}
|
||||||
'session.destroy': {
|
'session.destroy': {
|
||||||
methods: ["POST"]
|
methods: ["POST"]
|
||||||
pattern: '/logout'
|
pattern: '/auth/logout'
|
||||||
types: {
|
types: {
|
||||||
body: {}
|
body: {}
|
||||||
paramsTuple: []
|
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/ComputerCard': ExtractProps<(typeof import('../../inertia/pages/widgets/ComputerCard.vue'))['default']>
|
||||||
'widgets/ComputerComponentsTable': ExtractProps<(typeof import('../../inertia/pages/widgets/ComputerComponentsTable.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/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/DeleteConfirmationModal': ExtractProps<(typeof import('../../inertia/pages/widgets/DeleteConfirmationModal.vue'))['default']>
|
||||||
'widgets/SimpleGallery': ExtractProps<(typeof import('../../inertia/pages/widgets/SimpleGallery.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/TableComponent': ExtractProps<(typeof import('../../inertia/pages/widgets/TableComponent.vue'))['default']>
|
||||||
'widgets/ValidationError': ExtractProps<(typeof import('../../inertia/pages/widgets/ValidationError.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.
|
* Send cookies only over HTTPS in production.
|
||||||
*/
|
*/
|
||||||
secure: app.inProduction,
|
secure: false,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cross-site policy for cookie sending.
|
* Cross-site policy for cookie sending.
|
||||||
|
|||||||
+1
-1
@@ -43,7 +43,7 @@ const sessionConfig = defineConfig({
|
|||||||
/**
|
/**
|
||||||
* Send cookies only over HTTPS in production.
|
* Send cookies only over HTTPS in production.
|
||||||
*/
|
*/
|
||||||
secure: app.inProduction,
|
secure: false,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cross-site policy for cookie sending.
|
* Cross-site policy for cookie sending.
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ const user = computed(() => {
|
|||||||
|
|
||||||
<Link
|
<Link
|
||||||
href="/auth/logout"
|
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"
|
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>
|
<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
|
||||||
APP_KEY: Env.schema.secret(),
|
APP_KEY: Env.schema.secret(),
|
||||||
|
APP_URL: Env.schema.string(),
|
||||||
|
|
||||||
// Session
|
// Session
|
||||||
SESSION_DRIVER: Env.schema.enum(['cookie', 'memory', 'database'] as const),
|
SESSION_DRIVER: Env.schema.enum(['cookie', 'memory', 'database'] as const),
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ router
|
|||||||
.group(() => {
|
.group(() => {
|
||||||
router.post('logout', [controllers.Session, 'destroy'])
|
router.post('logout', [controllers.Session, 'destroy'])
|
||||||
})
|
})
|
||||||
|
.prefix('/auth')
|
||||||
.use(middleware.auth())
|
.use(middleware.auth())
|
||||||
|
|
||||||
router
|
router
|
||||||
|
|||||||
Reference in New Issue
Block a user