Skip to content

Commit

Permalink
fix: Login Provider를 String type으로 받는다.
Browse files Browse the repository at this point in the history
  • Loading branch information
rlarltj committed Aug 6, 2024
1 parent b397ebf commit 981afa6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package com.dnd.accompany.domain.auth.oauth.dto;

import com.dnd.accompany.domain.auth.oauth.service.OAuthProvider;

public record LoginRequest(
OAuthProvider provider,
String provider,
String accessToken
) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ public enum OAuthProvider {

private final String name;

public static OAuthProvider get(OAuthProvider oAuthProvider) {
public static OAuthProvider get(String name) {
return Arrays.stream(OAuthProvider.values())
.filter(provider -> provider.equals(oAuthProvider))
.filter(provider -> provider.getName().equals(name))
.findAny()
.orElseThrow(() -> new NotFoundException(ErrorCode.INVALID_PROVIDER));
}
Expand Down

0 comments on commit 981afa6

Please sign in to comment.