Skip to content

Commit

Permalink
fix: name (keephq#1074)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahargl authored Apr 9, 2024
1 parent 9ed524c commit 5ba94de
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions keep-ui/pages/api/auth/[...nextauth].ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ const multiTenantAuthOptions = {
if ((profile as any)?.given_name) {
const givenName = (profile as any).given_name;
token.name = givenName;
} else if ((profile as any)?.name) {
// split by " " and take the first part
const name = (profile as any).name as string;
const nameParts = name.split(" ");
// verify that the name is not empty (should not happen, but just in case)
if (nameParts.length > 0){
token.name = nameParts[0];
}
}


Expand Down

0 comments on commit 5ba94de

Please sign in to comment.