-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 소셜 로그인 시 랜딩할 페이지 결정에 사용할 헤더 추가 (#64)
* feat: 랜딩 상태 추가 * feat: oauth2 인증주체에 랜딩상태 필드 추가 * refactor: 미사용 메서드 제거 * feat: 소셜 로그인 응답 헤더에 랜딩상태 추가
- Loading branch information
Showing
4 changed files
with
32 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/main/java/com/gdschongik/gdsc/global/security/LandingStatus.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.gdschongik.gdsc.global.security; | ||
|
||
import com.gdschongik.gdsc.domain.member.domain.Member; | ||
import com.gdschongik.gdsc.domain.member.domain.RequirementStatus; | ||
|
||
public enum LandingStatus { | ||
TO_STUDENT_AUTHENTICATION, // 재학생 인증 페이지로 랜딩 | ||
TO_REGISTRATION, // 가입신청 페이지로 랜딩 | ||
TO_DASHBOARD, // 대시보드로 랜딩 | ||
; | ||
|
||
public static LandingStatus of(Member member) { | ||
// 아직 재학생 인증을 하지 않았다면 재학생 인증 페이지로 랜딩 | ||
if (member.getRequirement().getUnivStatus() == RequirementStatus.PENDING) { | ||
return TO_STUDENT_AUTHENTICATION; | ||
} | ||
|
||
// 재학생 인증은 했지만 가입신청을 하지 않았다면 가입신청 페이지로 랜딩 | ||
// 가입신청 여부는 학번 존재여부로 판단 | ||
if (member.getStudentId() == null) { | ||
return TO_REGISTRATION; | ||
} | ||
|
||
// 재학생 인증과 가입신청을 모두 완료했다면 대시보드로 랜딩 | ||
return TO_DASHBOARD; | ||
} | ||
} |