Skip to content

Supabase refresh token revoked before usage on client #27

@artandrey

Description

@artandrey

Please update SupabaseBaseAuthStrategy in passport-supabase lib to make sure that node js will not refresh token before sending it to client

import { SupabaseClient, createClient } from '@supabase/supabase-js';
import { Strategy } from 'passport-strategy';

import { ISupabaseClientOptions } from '../../core';

export interface ISupabaseBaseAuthStrategyOptions extends ISupabaseClientOptions {}

export abstract class SupabaseBaseAuthStrategy extends Strategy {
  private readonly _supabaseClient: SupabaseClient;

  constructor(options: ISupabaseBaseAuthStrategyOptions) {
    super();
    this._supabaseClient = createClient(options.supabaseUrl, options.supabaseKey, {
      auth: {
        autoRefreshToken: false, // add this
      },
    });
  }

  protected get supabaseClient() {
    return this._supabaseClient;
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions