test(auth): cover missing OIDC username fallback
This commit is contained in:
1 parent
36f197aa6d
commit
f82412587d
1 file changed
+8
@@ -66,6 +66,14 @@ describe("extractProfileName", () => {
|
||||
expect(extractProfileName(profile)).toBeUndefined();
|
||||
});
|
||||
|
||||
test("returns undefined when preferred_username is missing", () => {
|
||||
const profile = {
|
||||
sub: "user-id",
|
||||
} satisfies Profile;
|
||||
|
||||
expect(extractProfileName(profile)).toBeUndefined();
|
||||
});
|
||||
|
||||
test("uses a nested name claim when configured", () => {
|
||||
mockEnv.AUTH_OIDC_NAME_ATTRIBUTE_OVERWRITE = "user.profile.display_name";
|
||||
const profile = {
|
||||
|
||||
Reference in new issue
Block a user