Skip to content

Commit

Permalink
πŸš€ [Deploy] - μ„œλ²„ λ‚ μ§œ μ„€μ • 및 μœ μ € λ‹‰λ„€μž„ μ„€μ • 반영 (#16)
Browse files Browse the repository at this point in the history
* Feat: customException κ΅¬ν˜„

* Feat: responseDto κ΅¬ν˜„

* Feat: Spring Security, JWT Cookie, μ†Œμ…œ 둜그인 κΈ°λŠ₯ κ΅¬ν˜„

* Feat: Spring Security, JWT Cookie, μ†Œμ…œ 둜그인 κΈ°λŠ₯ κ΅¬ν˜„

* Fix: μ½”λ“œ μ—λŸ¬ μˆ˜μ •

* Refactor: 아직 μ‚¬μš©ν•˜μ§€ μ•ŠλŠ” μ½”λ“œ μ‚­μ œ

* Feat: oauth2 μ˜μ‘΄μ„± μΆ”κ°€

* Chore: Credentials μΆ”κ°€

* ✨ [Feature] - μ„œλ²„ λ‚ μ§œ μ„€μ • 및 μœ μ € λ‹‰λ„€μž„ μ„€μ • (#15)

* Feat: μŠ€ν”„λ§ μ„œλ²„ μ‹œκ°„ ν•œκ΅­μœΌλ‘œ μ„€μ •

* Feat: μ‚¬μš©μž λ‹‰λ„€μž„ 지정 둜직 μΆ”κ°€

* Fix: 초기 포인트 μ„€μ •

---------

Co-authored-by: Jang99u <[email protected]>
Co-authored-by: λ―Όμž₯규 <[email protected]>
  • Loading branch information
3 people authored May 6, 2024
1 parent 0985de4 commit 61d2c4c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
8 changes: 8 additions & 0 deletions src/main/java/ice/spot/SpotApplication.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
package ice.spot;

import jakarta.annotation.PostConstruct;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.util.TimeZone;

@SpringBootApplication
public class SpotApplication {

@PostConstruct
public void init() {
TimeZone.setDefault(TimeZone.getTimeZone("Asia/Seoul"));
}

public static void main(String[] args) {
SpringApplication.run(SpotApplication.class, args);
}
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/ice/spot/domain/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,21 @@ public class User {
private String refreshToken;

@Builder
public User(String serialId, String password, String nickname, ERole role, EProvider provider, Long point) {
public User(String serialId, String password, String nickname, ERole role, EProvider provider) {
this.serialId = serialId;
this.password = password;
this.nickname = nickname;
this.role = role;
this.provider = provider;
this.point = point;
this.point = 0L;
this.createdAt = LocalDate.now();
}

public void register(String nickname) {
this.nickname = nickname;
this.createdAt = LocalDate.now();
this.role = ERole.USER;
this.point = 0L;
}

public void updateRefreshToken(String refreshToken) {
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/ice/spot/security/info/KakaoOauth2UserInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,9 @@ public KakaoOauth2UserInfo(Map<String, Object> attributes) {
public String getId() {
return attributes.get("id").toString();
}

@Override
public String getNickname() {
return attributes.get("nickname").toString();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
public abstract class Oauth2UserInfo {
protected final Map<String, Object> attributes;
public abstract String getId();
public abstract String getNickname();
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ public OAuth2User loadUser(
bCryptPasswordEncoder
.encode(UUID.randomUUID().toString())
)
.nickname(oauth2UserInfo.getNickname())
.provider(provider)
.role(ERole.GUEST)
.role(ERole.USER)
.build()
);
return UserRepository.UserSecurityForm.invoke(newUser);
Expand Down

0 comments on commit 61d2c4c

Please sign in to comment.