feat: add login in frontend

* extract icon library from main.js
* extract router from main.js
* failure with error in passport
* add example to swagger
This commit is contained in:
Lin, Hung-Shin committed 2023-09-13 14:02:28 +08:00
1 parent b55b7aa1ec
commit 49417c405a
11 files changed
+206 -61

No files matched your search

+1 -1
View File
@@ -11,7 +11,7 @@ const router = Router()
router.post(
'/login',
passport.authenticate('local', { session: false }),
passport.authenticate('local', { session: false, failWithError: true }),
issueToken
)
+2 -2
View File
@@ -15,12 +15,12 @@ router.use('/auth', authRouter)
router.use('/quests', quests)
router.use(
'/sessions',
passport.authenticate('jwt', { session: false }),
passport.authenticate('jwt', { session: false, failWithError: true }),
sessions
)
router.use(
'/commands',
passport.authenticate('jwt', { session: false }),
passport.authenticate('jwt', { session: false, failWithError: true }),
commands
)
+1
View File
@@ -62,6 +62,7 @@ paths:
properties:
quest_id:
type: string
example: helloworld
responses:
'201':
description: session created