File tree Expand file tree Collapse file tree 2 files changed +27
-3
lines changed
backend/src/packages/auth
frontend/src/libs/components/protected-route Expand file tree Collapse file tree 2 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -390,3 +390,26 @@ export { AuthController };
390
390
* type: string
391
391
* example: This email is not registered
392
392
*/
393
+
394
+ /**
395
+ * @swagger
396
+ * /auth/logout:
397
+ * get:
398
+ * tags:
399
+ * - auth
400
+ * description: Log out of the system
401
+ * security:
402
+ * - {}
403
+ * - bearerAuth: []
404
+ * responses:
405
+ * 204:
406
+ * description: Successful operation
407
+ * 401:
408
+ * UnauthorizedError:
409
+ * description:
410
+ * You are not authorized
411
+ * content:
412
+ * plain/text:
413
+ * schema:
414
+ * $ref: '#/components/schemas/UnauthorizedError'
415
+ */
Original file line number Diff line number Diff line change 1
- import { DataStatus } from '~/libs/enums/enums.js' ;
1
+ import { Navigate } from 'react-router-dom' ;
2
+
3
+ import { AppRoute , DataStatus } from '~/libs/enums/enums.js' ;
2
4
import { useAppSelector } from '~/libs/hooks/hooks.js' ;
3
5
import { type ValueOf } from '~/libs/types/types.js' ;
4
6
import { type UserGroupKey } from '~/packages/users/libs/enums/enums.js' ;
5
- import { NotFound } from '~/pages/not-found/not-found.js' ;
6
7
import { useAuthUser } from '~/slices/auth/auth.js' ;
7
8
import { selectIsLoading } from '~/slices/auth/selectors.js' ;
8
9
@@ -26,7 +27,7 @@ const ProtectedRoute = ({
26
27
return user && allowedUserGroup === user . group . key ? (
27
28
< RouterOutlet />
28
29
) : (
29
- < NotFound />
30
+ < Navigate to = { AppRoute . SIGN_IN } />
30
31
) ;
31
32
} ;
32
33
You can’t perform that action at this time.
0 commit comments