File tree 2 files changed +9
-0
lines changed
2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ export default class GoTrueApi {
67
67
options : {
68
68
redirectTo ?: string
69
69
scopes ?: string
70
+ queryParams ?: { [ key : string ] : string }
70
71
}
71
72
) {
72
73
const urlParams : string [ ] = [ `provider=${ encodeURIComponent ( provider ) } ` ]
@@ -76,6 +77,10 @@ export default class GoTrueApi {
76
77
if ( options ?. scopes ) {
77
78
urlParams . push ( `scopes=${ encodeURIComponent ( options . scopes ) } ` )
78
79
}
80
+ if ( options ?. queryParams ) {
81
+ const query = new URLSearchParams ( options . queryParams )
82
+ urlParams . push ( `${ query } ` )
83
+ }
79
84
return `${ this . url } /authorize?${ urlParams . join ( '&' ) } `
80
85
}
81
86
Original file line number Diff line number Diff line change @@ -201,6 +201,7 @@ export default class GoTrueClient {
201
201
shouldCreateUser ?: boolean
202
202
scopes ?: string
203
203
captchaToken ?: string
204
+ queryParams ?: { [ key : string ] : string }
204
205
} = { }
205
206
) : Promise < {
206
207
session : Session | null
@@ -250,6 +251,7 @@ export default class GoTrueClient {
250
251
return this . _handleProviderSignIn ( provider , {
251
252
redirectTo : options . redirectTo ,
252
253
scopes : options . scopes ,
254
+ queryParams : options . queryParams ,
253
255
} )
254
256
}
255
257
if ( oidc ) {
@@ -559,11 +561,13 @@ export default class GoTrueClient {
559
561
options : {
560
562
redirectTo ?: string
561
563
scopes ?: string
564
+ queryParams ?: { [ key : string ] : string }
562
565
} = { }
563
566
) {
564
567
const url : string = this . api . getUrlForProvider ( provider , {
565
568
redirectTo : options . redirectTo ,
566
569
scopes : options . scopes ,
570
+ queryParams : options . queryParams
567
571
} )
568
572
569
573
try {
You can’t perform that action at this time.
0 commit comments