refactor: split backend by context instead of type 'controllers/models/...'

This commit is contained in:
Sonny
2024-11-10 22:26:00 +01:00
parent 466c8dec3a
commit 01efb11f70
78 changed files with 230 additions and 228 deletions

View File

@@ -0,0 +1,27 @@
import { middleware } from '#start/kernel';
import router from '@adonisjs/core/services/router';
const AuthController = () => import('#auth/controllers/auth_controller');
const ROUTES_PREFIX = '/auth';
/**
* Auth routes for unauthicated users
*/
router
.group(() => {
router.get('/google', [AuthController, 'google']).as('auth');
router
.get('/callback', [AuthController, 'callbackAuth'])
.as('auth.callback');
})
.prefix(ROUTES_PREFIX);
/**
* Routes for authenticated users
*/
router
.group(() => {
router.get('/logout', [AuthController, 'logout']).as('auth.logout');
})
.middleware([middleware.auth()])
.prefix(ROUTES_PREFIX);

View File

@@ -0,0 +1 @@
import './auth_routes.js';