Skip to content

Commit

Permalink
✏️ ㅇ
Browse files Browse the repository at this point in the history
  • Loading branch information
labyrinth30 committed Jun 29, 2024
1 parent fff4c6f commit 5aa85a8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ export class AuthService {
return this.usersService.createUser(createUserDto);
}

loginUser(
user: Pick<UsersModel, 'email' | 'id' | 'nickname'>,
res: Response,
) {
loginUser(user: Pick<UsersModel, 'email' | 'id' | 'nickname'>) {
const accessToken = this.signToken(user);
console.log('accessToken:', accessToken);
return res.json({ accessToken, nickname: user.nickname });
return {
accessToken,
nickname: user.nickname,
};
}

async kakaoLogin(
Expand Down Expand Up @@ -122,10 +122,10 @@ export class AuthService {
// 사용자 정보가 없으면 회원가입
if (!user) {
user = await this.registerUser(email, nickname);
return this.loginUser(user, res);
return this.loginUser(user);
}
// 로그인
return this.loginUser(user, res);
return this.loginUser(user);
} catch (e) {
console.error('Error during Kakao login:', e);
throw new UnauthorizedException('카카오 로그인 중 오류가 발생했습니다.');
Expand Down

0 comments on commit 5aa85a8

Please sign in to comment.