mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-08 14:43:24 +00:00
feat: add auth via google
This commit is contained in:
@@ -35,4 +35,13 @@ export default await Env.create(new URL('../', import.meta.url), {
|
||||
DB_USER: Env.schema.string(),
|
||||
DB_PASSWORD: Env.schema.string.optional(),
|
||||
DB_DATABASE: Env.schema.string(),
|
||||
|
||||
/*
|
||||
|----------------------------------------------------------
|
||||
| Variables for configuring ally package
|
||||
|----------------------------------------------------------
|
||||
*/
|
||||
GOOGLE_CLIENT_ID: Env.schema.string(),
|
||||
GOOGLE_CLIENT_SECRET: Env.schema.string(),
|
||||
GOOGLE_CLIENT_CALLBACK_URL: Env.schema.string(),
|
||||
});
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Routes file
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The routes file is used for defining the HTTP routes.
|
||||
|
|
||||
*/
|
||||
|
||||
import router from '@adonisjs/core/services/router';
|
||||
router.on('/inertia').renderInertia('home', { version: 6 });
|
||||
|
||||
const UsersController = () => import('#controllers/users_controller');
|
||||
const AppsController = () => import('#controllers/apps_controller');
|
||||
|
||||
router.get('/', [AppsController, 'index']);
|
||||
|
||||
router.get('/auth/login', [UsersController, 'google']);
|
||||
router.get('/auth/callback', [UsersController, 'callbackAuth']);
|
||||
router.get('/auth/logout', [UsersController, 'logout']);
|
||||
|
||||
Reference in New Issue
Block a user