From 4c2e7a0be470bc00044a49c34bef5a3c80f8345b Mon Sep 17 00:00:00 2001 From: vran Date: Tue, 15 Feb 2022 21:33:23 +0800 Subject: [PATCH] fix: username is wrong after login --- .../config/security/DatabasirAuthenticationSuccessHandler.java | 2 +- api/src/main/resources/application-local.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/main/java/com/databasir/api/config/security/DatabasirAuthenticationSuccessHandler.java b/api/src/main/java/com/databasir/api/config/security/DatabasirAuthenticationSuccessHandler.java index af36496..220bd73 100644 --- a/api/src/main/java/com/databasir/api/config/security/DatabasirAuthenticationSuccessHandler.java +++ b/api/src/main/java/com/databasir/api/config/security/DatabasirAuthenticationSuccessHandler.java @@ -48,7 +48,7 @@ public class DatabasirAuthenticationSuccessHandler implements AuthenticationSucc data.setId(user.getUserPojo().getId()); data.setNickname(user.getUserPojo().getNickname()); data.setEmail(user.getUserPojo().getEmail()); - data.setUsername(user.getUsername()); + data.setUsername(user.getUserPojo().getUsername()); LoginKeyResponse loginKey = loginService.generate(user.getUserPojo().getId()); data.setAccessToken(loginKey.getAccessToken()); diff --git a/api/src/main/resources/application-local.properties b/api/src/main/resources/application-local.properties index 8f47aef..b3da7a4 100644 --- a/api/src/main/resources/application-local.properties +++ b/api/src/main/resources/application-local.properties @@ -6,6 +6,6 @@ spring.datasource.password=123456 spring.datasource.url=jdbc:mysql://localhost:3306/databasir spring.jooq.sql-dialect=mysql -spring.flyway.enabled=false +spring.flyway.enabled=true spring.flyway.baseline-on-migrate=true spring.flyway.locations=classpath:db/migration \ No newline at end of file