mirror of
https://github.com/sct/overseerr.git
synced 2025-09-17 17:24:35 +02:00
feat(api): initial implementation of the auth system (#30)
Adds the auth system but does not add all required features. They will be handled in other tickets
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
import { Router } from 'express';
|
||||
import user from './user';
|
||||
import authRoutes from './auth';
|
||||
import { checkUser, isAuthenticated } from '../middleware/auth';
|
||||
|
||||
const router = Router();
|
||||
|
||||
router.use('/user', user);
|
||||
router.use(checkUser);
|
||||
router.use('/user', isAuthenticated, user);
|
||||
router.use('/auth', authRoutes);
|
||||
|
||||
router.get('/', (req, res) => {
|
||||
return res.status(200).json({
|
||||
@@ -12,4 +16,8 @@ router.get('/', (req, res) => {
|
||||
});
|
||||
});
|
||||
|
||||
router.all('*', (req, res) =>
|
||||
res.status(404).json({ status: 404, message: '404 Not Found' })
|
||||
);
|
||||
|
||||
export default router;
|
||||
|
Reference in New Issue
Block a user