We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7a6a7ab commit 93dac65Copy full SHA for 93dac65
src/plugins/auth.ts
@@ -59,7 +59,7 @@ export type AadToken = {
59
amr: string[];
60
appid: string;
61
appidacr: string;
62
- email: string;
+ email?: string;
63
groups?: string[];
64
idp: string;
65
ipaddr: string;
@@ -176,7 +176,7 @@ const authPlugin: FastifyPluginAsync = async (fastify, _options) => {
176
verifyOptions,
177
) as AadToken;
178
request.tokenPayload = verifiedTokenData;
179
- request.username = verifiedTokenData.email;
+ request.username = verifiedTokenData.email || verifiedTokenData.sub;
180
const userRoles = new Set([] as AppRoles[]);
181
const expectedRoles = new Set(validRoles);
182
if (verifiedTokenData.groups) {
0 commit comments