Skip to content

Commit 86dcadd

Browse files
fix: strip query params when redirecting to provider
1 parent 0d3fe56 commit 86dcadd

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/components/Login/OidcLoginButton.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ export default function OidcLoginButton({
2929
const redirectToLogin = useCallback(async () => {
3030
setLoading(true);
3131
try {
32-
await initiateOidcLogin(provider.slug, window.location.href);
32+
await initiateOidcLogin(
33+
provider.slug,
34+
new URL(window.location.pathname, window.location.origin).toString()
35+
);
3336
} catch (e) {
3437
setLoading(false);
3538
const errorCode = (e as { response?: { data?: { error?: string } } })

src/components/UserProfile/UserSettings/UserLinkedAccountsSettings/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,10 @@ const UserLinkedAccountsSettings = () => {
199199
name: p.name,
200200
action: async () => {
201201
try {
202-
await initiateOidcLogin(p.slug, window.location.href);
202+
await initiateOidcLogin(
203+
p.slug,
204+
new URL(window.location.pathname, window.location.origin).toString()
205+
);
203206
} catch {
204207
setError(intl.formatMessage(messages.errorUnknown));
205208
}

0 commit comments

Comments
 (0)