Skip to content

Commit 65ddc42

Browse files
committed
fix entra ID token get function
1 parent 90d618b commit 65ddc42

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

src/api/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ async function init(prettyPrint: boolean = false) {
275275
);
276276
await app.register(cors, {
277277
origin: app.environmentConfig.ValidCorsOrigins,
278+
methods: ["GET", "HEAD", "POST", "PATCH", "DELETE"],
278279
});
279280
app.log.info("Initialized new Fastify instance...");
280281
return app;

src/api/routes/iam.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ const iamRoutes: FastifyPluginAsync = async (fastify, _options) => {
9292
const entraIdToken = await getEntraIdToken(
9393
await getAuthorizedClients(),
9494
fastify.environmentConfig.AadValidClientId,
95+
undefined,
96+
genericConfig.EntraSecretName,
9597
);
9698
await patchUserProfile(
9799
entraIdToken,

src/ui/pages/profile/ManageProfile.page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ export const ManageProfilePage: React.FC = () => {
5151

5252
const setProfile = async (data: UserProfileData) => {
5353
const newOtherEmails = [data.mail || data.userPrincipalName];
54-
if (data.discordUsername && data.discordUsername !== "") {
55-
newOtherEmails.push(`${data.discordUsername}@discord`);
54+
if (data.discordUsername && data.discordUsername.trim() !== "") {
55+
newOtherEmails.push(`${data.discordUsername.trim()}@discord`);
5656
}
5757
data.otherMails = newOtherEmails;
5858
delete data.discordUsername;

0 commit comments

Comments
 (0)