File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import React from 'react'
33import LinkOAuth from './LinkOAuth'
44import LoginWithOAuth from './LoginWithOAuth'
55import SignupWithOAuth from './SignupWithOAuth'
6- import { FTGetOAuthUrls } from '../oauth'
6+ import { FTGetOAuthUrls , IGetOAuthUrlsConfig } from '../oauth'
77import { ILinkOAuthConfig } from './buttonTypes'
88
99interface IOAuthButtonsProps {
@@ -31,6 +31,7 @@ interface IOAuthButtonsProps {
3131 * ```
3232 */
3333 getOAuthUrls : FTGetOAuthUrls
34+ redirectUrlOverride : IGetOAuthUrlsConfig [ 'redirectUrlOverride' ]
3435 /**
3536 * When the `action` is `link`, this config is required.
3637 */
@@ -41,6 +42,7 @@ const OAuthButtons = ({
4142 action,
4243 layoutClasses = 'flex gap-2 flex-wrap justify-center' ,
4344 getOAuthUrls,
45+ redirectUrlOverride,
4446 linkOAuthConfig,
4547} : IOAuthButtonsProps ) => {
4648 if ( ! linkOAuthConfig && action === 'link' ) {
@@ -49,7 +51,7 @@ const OAuthButtons = ({
4951 )
5052 }
5153
52- const oAuthUrls = getOAuthUrls ( { method : action } )
54+ const oAuthUrls = getOAuthUrls ( { method : action , redirectUrlOverride } )
5355 return (
5456 < ul className = { layoutClasses } >
5557 { ( ( ) => {
Original file line number Diff line number Diff line change @@ -9,11 +9,12 @@ export interface IConnectedAccountRecord {
99 createdAt : Date
1010}
1111
12- interface IGetOAuthUrlsConfig {
12+ export interface IGetOAuthUrlsConfig {
1313 /**
1414 * By default, the redirect URL will be to whatever page the user is on when
1515 * they click the button. If you want to override this, you can pass in a
1616 * `redirectUrlOverride`.
17+ * Default is `window.location.origin + window.location.pathname`.
1718 */
1819 redirectUrlOverride ?: string
1920 /**
You can’t perform that action at this time.
0 commit comments