Fix login 401, admin permission, video links serialization, and admin UI styling
- Fix UserInfo boolean field naming (isAdmin → admin) for proper Jackson/MyBatis mapping - Configure Google OAuth audience with actual client ID to fix token verification - Parse CLOB fields and convert Oracle TIMESTAMP in restaurant video links API - Add explicit bg-white/text-gray-900 to admin page inputs, selects, and table headers - Add keyPrefix to RestaurantList to avoid duplicate React keys across desktop/mobile Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -16,7 +16,7 @@ public class UserInfo {
|
||||
private String nickname;
|
||||
private String avatarUrl;
|
||||
@JsonProperty("is_admin")
|
||||
private boolean isAdmin;
|
||||
private boolean admin;
|
||||
private String provider;
|
||||
private String providerId;
|
||||
private String createdAt;
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.google.api.client.http.javanet.NetHttpTransport;
|
||||
import com.google.api.client.json.gson.GsonFactory;
|
||||
import com.tasteby.domain.UserInfo;
|
||||
import com.tasteby.security.JwtTokenProvider;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.server.ResponseStatusException;
|
||||
@@ -20,12 +21,13 @@ public class AuthService {
|
||||
private final JwtTokenProvider jwtProvider;
|
||||
private final GoogleIdTokenVerifier verifier;
|
||||
|
||||
public AuthService(UserService userService, JwtTokenProvider jwtProvider) {
|
||||
public AuthService(UserService userService, JwtTokenProvider jwtProvider,
|
||||
@Value("${app.google.client-id}") String googleClientId) {
|
||||
this.userService = userService;
|
||||
this.jwtProvider = jwtProvider;
|
||||
this.verifier = new GoogleIdTokenVerifier.Builder(
|
||||
new NetHttpTransport(), GsonFactory.getDefaultInstance())
|
||||
.setAudience(Collections.emptyList()) // Accept any audience
|
||||
.setAudience(Collections.singletonList(googleClientId))
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,13 @@ public class RestaurantService {
|
||||
|
||||
public List<Map<String, Object>> findVideoLinks(String restaurantId) {
|
||||
var rows = mapper.findVideoLinks(restaurantId);
|
||||
return rows.stream().map(JsonUtil::lowerKeys).toList();
|
||||
return rows.stream().map(row -> {
|
||||
var m = JsonUtil.lowerKeys(row);
|
||||
m.put("foods_mentioned", JsonUtil.parseStringList(m.get("foods_mentioned")));
|
||||
m.put("evaluation", JsonUtil.parseMap(m.get("evaluation")));
|
||||
m.put("guests", JsonUtil.parseStringList(m.get("guests")));
|
||||
return m;
|
||||
}).toList();
|
||||
}
|
||||
|
||||
public void update(String id, Map<String, Object> fields) {
|
||||
|
||||
Reference in New Issue
Block a user