diff --git a/app/Controllers/Http/AuthController.ts b/app/Controllers/Http/AuthController.ts
index 1416c8d..c118be1 100644
--- a/app/Controllers/Http/AuthController.ts
+++ b/app/Controllers/Http/AuthController.ts
@@ -1,18 +1,16 @@
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
import { schema } from '@ioc:Adonis/Core/Validator'
-import Logger from '@ioc:Adonis/Core/Logger'
export default class AuthController {
- public async login({ auth, request, response }: HttpContextContract){
-
- Logger.info("entering login")
- Logger.info(JSON.stringify(request.all()))
+ public async login({ auth, request, response, session }: HttpContextContract){
+
const loginSchema = schema.create({
username: schema.string({trim: true}),
password: schema.string()
})
+
const { username, password } = await request.validate({
schema: loginSchema,
messages: {
@@ -24,9 +22,14 @@ export default class AuthController {
response.redirect().toRoute('events.index')
}
- public async logout({ auth, response }: HttpContextContract) {
+ public async logout({ auth, response, session }: HttpContextContract) {
await auth.logout()
+ session.flash('errors', {
+ logout: 'test'
+ })
+
+
response.redirect('/login')
}
}
diff --git a/components.d.ts b/components.d.ts
index e28c154..65c29dd 100644
--- a/components.d.ts
+++ b/components.d.ts
@@ -7,7 +7,6 @@ export {}
declare module 'vue' {
export interface GlobalComponents {
- NAlert: typeof import('naive-ui')['NAlert']
NButton: typeof import('naive-ui')['NButton']
NForm: typeof import('naive-ui')['NForm']
NFormItem: typeof import('naive-ui')['NFormItem']
diff --git a/resources/js/Layouts/LoginLayout.vue b/resources/js/Layouts/LoginLayout.vue
index 7720716..2063e05 100644
--- a/resources/js/Layouts/LoginLayout.vue
+++ b/resources/js/Layouts/LoginLayout.vue
@@ -1,9 +1,7 @@
-
-
-
\ No newline at end of file
+
diff --git a/resources/js/components/MainNav.vue b/resources/js/components/MainNav.vue
index a6550db..8b05594 100644
--- a/resources/js/components/MainNav.vue
+++ b/resources/js/components/MainNav.vue
@@ -1,5 +1,10 @@
-
+