Skip to content

Commit b7b4f64

Browse files
gonchantechhf
authored andcommitted
fix(auth): avoid window.location access in SSR environments
1 parent 9a6edb9 commit b7b4f64

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/GoTrueClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ export default class GoTrueClient {
362362
*/
363363
private async _initialize(): Promise<InitializeResult> {
364364
try {
365-
const params = parseParametersFromURL(window.location.href)
365+
const params = isBrowser() ? parseParametersFromURL(window.location.href) : {}
366366
let callbackUrlType = 'none'
367367
if (this._isImplicitGrantCallback(params)) {
368368
callbackUrlType = 'implicit'

0 commit comments

Comments
 (0)