Skip to content

Commit

Permalink
feat: status-check 내에 로그인 상태검사 로직 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Zero-1016 committed Mar 3, 2025
1 parent b5f6751 commit 899189e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/backend/auth-server/src/controllers/auth/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FastifyRequest, FastifyReply } from 'fastify';
import { generateHash } from '../../libs/authHelper';
import { generateHash, shortVerifyRefreshToken } from '../../libs/authHelper';
import { ERROR_MESSAGE, REDIS_KEY } from '../../libs/constants';
import { SUCCESS_MESSAGE } from '../../libs/constants';
import { handleError } from '../../libs/errorHelper';
Expand Down Expand Up @@ -178,7 +178,13 @@ function authController() {
return;
}

handleSuccess(res, SUCCESS_MESSAGE.loginStatusOK, 200);
try {
shortVerifyRefreshToken(refreshToken);
handleSuccess(res, SUCCESS_MESSAGE.loginStatusOK, 200);
} catch (error) {
handleError(res, ERROR_MESSAGE.unauthorized, error);
return;
}
};

return {
Expand Down
1 change: 1 addition & 0 deletions src/backend/auth-server/src/routes/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const authRoute = async (app: FastifyInstance) => {
app.withTypeProvider<ZodTypeProvider>().route({
method: 'GET',
url: '/status-check',
preHandler: [verifySignIn],
schema: loginStatusCheckSchema,
handler: authController.loginStatusCheck,
});
Expand Down

0 comments on commit 899189e

Please sign in to comment.