GithubHelp home page GithubHelp logo

nestjs-supabase-auth's Issues

Supabase.js v2 Cannot read properties of undefined (reading 'getUser')

[Nest] 20112  - 21/01/2023, 09:58:12   ERROR [ExceptionsHandler] Cannot read properties of undefined (reading 'getUser')
TypeError: Cannot read properties of undefined (reading 'getUser')
    at SupabaseStrategy.authenticate (...\node_modules\nestjs-supabase-auth\src\passport-supabase.strategy.ts:50:8)
    at SupabaseStrategy.authenticate (...\dist\apps\api\webpack:\...\auth\strategies\supabase.strategy.ts:26:18)
    at attempt (...\node_modules\passport\lib\middleware\authenticate.js:369:16)
    at authenticate (...\node_modules\passport\lib\middleware\authenticate.js:370:7)
    at ...\node_modules\@nestjs\passport\dist\auth.guard.js:96:3
    at new Promise (<anonymous>)
    at ...\node_modules\@nestjs\passport\dist\auth.guard.js:88:83
    at SupabaseAuthGuard.<anonymous> (...\node_modules\@nestjs\passport\dist\auth.guard.js:49:36)
    at Generator.next (<anonymous>)
    at fulfilled (...\node_modules\@nestjs\passport\dist\auth.guard.js:17:58)

The culprit is this line:

this.supabase.auth.api <<<
      .getUser(idToken)

The fix is:

this.supabase.auth <<<
      .getUser(idToken)

Currently package "nestjs-supabase-auth": "1.0.9" works with:

@supabase/supabase-js": "^1.29.4

It doesn't work for:

"@supabase/supabase-js": "^2.4.1"

just lost my Job because of this package

Terrible validation, I had to create different patches for this, but the decorators are not validating anything, If my client doesn't suggest it, I don't use it, as my plan was to use the base jwt extractor that comes with Nestjs, thanks.

Nestjs don't work

user is undefined

try { const q = await this.authService.validate(req) console.log(q.email) return {n: ' p'} } catch (error) { console.log(error) }

An example for REST APIs

Can you add an exemple for a REST API, please?

I got confused trying to use your lib on a personal project. Can you help me?
I'm having trouble understanding some NestJS concepts while studying authentication and encryption.

๐Ÿ˜„

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.