Skip to content

Commit a561fd4

Browse files
fix: remove www. from redirect uri before check
The allowedDomains all have their www. removed, so we must do the same for the redirectUri to ensure that we can still match www.-prefixed domains.
1 parent 5882c0d commit a561fd4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

apps/api-server/src/services/isRedirectAllowed.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,14 @@ const isRedirectAllowed = async (projectId, redirectUri) => {
3636
return false;
3737
}
3838
});
39+
40+
let redirectHost = new URL(redirectUri).host;
41+
42+
if (redirectHost.startsWith('www.')) {
43+
redirectHost = redirectHost.slice(4);
44+
}
3945

40-
if(allowedDomains.includes(new URL(redirectUri).host)){
46+
if(allowedDomains.includes(redirectHost)){
4147
return true;
4248
}
4349
return false;

0 commit comments

Comments
 (0)