File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,14 @@ export class AccountController {
118118 } ) ;
119119 }
120120
121+ static async checkIfValidAuthSession ( req : Request , res : Response ) : Promise < void > {
122+ ensureAuthenticated ( req , res , async ( ) => {
123+ res . json ( {
124+ message : 'Valid auth session'
125+ } ) ;
126+ } ) ;
127+ }
128+
121129 static async getManyPublic ( req : Request , res : Response ) : Promise < void > {
122130 const getManyPublicSchema = Joi . object ( {
123131 page : Joi . number ( ) . integer ( ) . min ( 1 ) . optional ( ) ,
Original file line number Diff line number Diff line change @@ -12,5 +12,6 @@ router.post('/login', authenticate);
1212router . post ( '/logout' , logout ) ;
1313
1414router . get ( '/me' , asyncHandler ( AccountController . getLoggedInAccount ) ) ;
15+ router . get ( '/check-session' , asyncHandler ( AccountController . checkIfValidAuthSession ) ) ;
1516
1617export const authRouter = router ;
You can’t perform that action at this time.
0 commit comments