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

feat(getSession): option to suppress server side getSession warning manually #953

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
6 changes: 4 additions & 2 deletions src/GoTrueClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -912,9 +912,11 @@ export default class GoTrueClient {
* to the client. If that storage is based on request cookies for example,
* the values in it may not be authentic and therefore it's strongly advised
* against using this method and its results in such circumstances. A warning
* will be emitted if this is detected. Use {@link #getUser()} instead.
* will be emitted if this is detected, unless suppressWarning is set to true. Use {@link #getUser()} instead.
*/
async getSession() {
async getSession(options: {suppressWarning?: boolean} = {}) {
this.suppressGetSessionWarning = options?.suppressWarning ?? false

await this.initializePromise

const result = await this._acquireLock(-1, async () => {
Expand Down
Loading