Skip to content

Fix OAuth Providers Attributes Mapping With LC Attributes #614

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix auth provider attributes matching to lc attributes
  • Loading branch information
aq-ikhwa-tech committed Jan 3, 2024
commit 818cb5d3a01d63c3c6fb6c9fce5400b768c9df0f
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,10 @@ protected Mono<AuthUser> getAuthUser(AuthToken authToken) {
if (map.containsKey("error")) {
return Mono.error(new AuthException(JsonUtils.toJson(map)));
}
String username = MapUtils.getString(map, "email");
AuthUser authUser = AuthUser.builder()
.uid(map.get("id").toString())
.username(MapUtils.getString(map, "login"))
.username(username == null ? MapUtils.getString(map, "login") : username)
.avatar(MapUtils.getString(map, "avatar_url"))
.rawUserInfo(map)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ protected Mono<AuthUser> getAuthUser(AuthToken authToken) {
}
AuthUser authUser = AuthUser.builder()
.uid(MapUtils.getString(map, "sub"))
.username(MapUtils.getString(map, "name"))
.username(MapUtils.getString(map, "email"))
.avatar(MapUtils.getString(map, "picture"))
.rawUserInfo(map)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ protected Mono<AuthUser> getAuthUser(AuthToken authToken) {
}
AuthUser authUser = AuthUser.builder()
.uid(MapUtils.getString(map, "sub"))
.username(MapUtils.getString(map, "name"))
.username(MapUtils.getString(map, "email"))
.avatar(MapUtils.getString(map, "picture"))
.rawUserInfo(map)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ auth:
email:
enable: true
enable-register: true
workspace-creation: false
workspace-creation: true