Skip to content

Commit

Permalink
[FEATURE] 로그인 관련 API 스펙 변경 (#87)
Browse files Browse the repository at this point in the history
feat: 로그인 관련 API 스펙 변경 (#86)
  • Loading branch information
hyunmin0317 authored Oct 15, 2024
1 parent 87d0b37 commit 415dc70
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
package com.smunity.server.domain.account.dto;

import com.smunity.server.global.common.entity.enums.MemberRole;
import lombok.Builder;

@Builder
public record LoginResponseDto(
Long memberId,
MemberRole memberRole,
String accessToken,
String refreshToken
) {

public static LoginResponseDto of(Long memberId, String accessToken, String refreshToken) {
public static LoginResponseDto of(Long memberId, MemberRole memberRole, String accessToken, String refreshToken) {
return LoginResponseDto.builder()
.memberId(memberId)
.memberRole(memberRole)
.accessToken(accessToken)
.refreshToken(refreshToken)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private LoginResponseDto generateToken(Long memberId, MemberRole memberRole) {
String accessToken = jwtTokenProvider.createAccessToken(memberId, memberRole, false);
String refreshToken = jwtTokenProvider.createAccessToken(memberId, memberRole, true);
refreshTokenService.saveRefreshToken(memberId, refreshToken);
return LoginResponseDto.of(memberId, accessToken, refreshToken);
return LoginResponseDto.of(memberId, memberRole, accessToken, refreshToken);
}

private void validateUsername(String username) {
Expand Down

0 comments on commit 415dc70

Please sign in to comment.