Skip to content

Commit 468f99b

Browse files
authored
Merge pull request #228 from boostcampwm-2024/feat/#227-fix-user-decorator
🐛 fix: 유저 데코레이터 중복 로그인 핸들링
2 parents 21a5736 + b547cbc commit 468f99b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

back/src/auth/service/auth.service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ export class AuthService {
1212
this.redis = this.redisService.getOrThrow();
1313
}
1414

15-
async getUserIdFromSession(sid: string): Promise<[number, string] | null> {
15+
async getUserIdFromSession(sid: string): Promise<[number | null, string | null]> {
1616
const session = JSON.parse(await this.redis.get(`user:${sid}`));
17-
if (!session) return null;
17+
if (!session) return [null, null];
1818
const userId = session.id;
1919
const userLoginId = session.loginId;
20-
if (!userId || !userLoginId) return null;
20+
if (!userId || !userLoginId) return [null, null];
2121
return [userId, userLoginId];
2222
}
2323

0 commit comments

Comments
 (0)