refactor(auth): remove redirect_uri parameter from OAuth flow
Simplify OAuth login and account linking by removing the redirect_uri parameter from initiateLogin and initiateLink functions. The backend now handles callback URL construction internally.
This commit is contained in:
+2
-4
@@ -902,9 +902,8 @@ export const api = {
|
||||
request<LinkedAccountsResponse>('/auth/external/linked-accounts'),
|
||||
|
||||
// Initiate OAuth login flow — returns authorization_url to redirect the browser to
|
||||
initiateLogin: (provider: string, options?: { redirect_uri?: string; organization_id?: string; flow?: string; oidc_session_id?: string }) => {
|
||||
initiateLogin: (provider: string, options?: { organization_id?: string; flow?: string; oidc_session_id?: string }) => {
|
||||
const params = new URLSearchParams({ flow: options?.flow ?? 'login' });
|
||||
if (options?.redirect_uri) params.set('redirect_uri', options.redirect_uri);
|
||||
if (options?.organization_id) params.set('organization_id', options.organization_id);
|
||||
if (options?.oidc_session_id) params.set('oidc_session_id', options.oidc_session_id);
|
||||
return request<OAuthAuthorizeResponse>(`/auth/external/${provider}/authorize?${params.toString()}`, {
|
||||
@@ -914,10 +913,9 @@ export const api = {
|
||||
},
|
||||
|
||||
// Initiate account linking flow (requires auth)
|
||||
initiateLink: (provider: string, redirect_uri?: string) =>
|
||||
initiateLink: (provider: string) =>
|
||||
request<OAuthAuthorizeResponse>(`/auth/external/${provider}/link`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ redirect_uri }),
|
||||
credentials: 'include',
|
||||
}),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user