Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: added package name prefix to all console. methods in src/ #699

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/GoTrueClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export default class GoTrueClient {

if (this.persistSession && this.storage === localStorageAdapter && !supportsLocalStorage()) {
console.warn(
`No storage option exists to persist the session, which may result in unexpected behavior when using auth.
`[@supabase/gotrue-js] No storage option exists to persist the session, which may result in unexpected behavior when using auth.
If you want to set persistSession to true, please provide a storage option or you may set persistSession to false to disable this warning.`
)
}
Expand All @@ -184,7 +184,7 @@ export default class GoTrueClient {
this.broadcastChannel = new globalThis.BroadcastChannel(this.storageKey)
} catch (e: any) {
console.error(
'Failed to create a new BroadcastChannel, multi-tab state changes will not be available',
'[@supabase/gotrue-js] Failed to create a new BroadcastChannel, multi-tab state changes will not be available',
e
)
}
Expand Down Expand Up @@ -1112,7 +1112,7 @@ export default class GoTrueClient {
this.stateChangeEmitters.get(id)?.callback('INITIAL_SESSION', session)
} catch (err) {
this.stateChangeEmitters.get(id)?.callback('INITIAL_SESSION', null)
console.error(err)
console.error('[@supabase/gotrue-js]', err)
}
}

Expand Down Expand Up @@ -1253,7 +1253,7 @@ export default class GoTrueClient {
const { error } = await this._callRefreshToken(currentSession.refresh_token)

if (error) {
console.log(error.message)
console.log('[@supabase/gotrue-js]', error.message)
await this._removeSession()
}
}
Expand All @@ -1264,7 +1264,7 @@ export default class GoTrueClient {
this._notifyAllSubscribers('SIGNED_IN', currentSession)
}
} catch (err) {
console.error(err)
console.error('[@supabase/gotrue-js]', err)
return
}
}
Expand Down Expand Up @@ -1358,7 +1358,7 @@ export default class GoTrueClient {
window.removeEventListener('visibilitychange', callback)
}
} catch (e) {
console.error('removing visibilitychange callback failed', e)
console.error('[@supabase/gotrue-js] removing visibilitychange callback failed', e)
}
}

Expand Down Expand Up @@ -1469,7 +1469,7 @@ export default class GoTrueClient {
await this._callRefreshToken(session.refresh_token)
}
} catch (e: any) {
console.error('Auto refresh tick failed with error. This is likely a transient error.', e)
console.error('[@supabase/gotrue-js] Auto refresh tick failed with error. This is likely a transient error.', e)
}
}

Expand Down Expand Up @@ -1497,7 +1497,7 @@ export default class GoTrueClient {
// current visbility state
await this._onVisibilityChanged(true) // initial call
} catch (error) {
console.error('_handleVisibilityChange', error)
console.error('[@supabase/gotrue-js] _handleVisibilityChange', error)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ function base64urlencode(str: string) {
export async function generatePKCEChallenge(verifier: string) {
if (typeof crypto === 'undefined') {
console.warn(
'WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256.'
'[@supabase/gotrue-js] WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256.'
)
return verifier
}
Expand Down