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

Latest Release of supabase/gotrue returns a null session on /token?grant_type=refresh_token #348

Closed
Tracked by #25
acupofjose opened this issue Jan 17, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@acupofjose
Copy link

acupofjose commented Jan 17, 2022

Bug report

Describe the bug

When POSTing to the /token?grant_type=refresh_token endpoint it now returns null instead of a session.

To Reproduce

Using the following docker-compose.yml:

version: "3"
services:

  gotrue:
    image: supabase/gotrue:latest
    ports:
      - "9999:9999"
    environment:
      DATABASE_URL: "postgres://postgres:postgres@db:5432/postgres?sslmode=disable"
      GOTRUE_JWT_SECRET: "37c304f8-51aa-419a-a1af-06154e63707a"
      GOTRUE_JWT_EXP: 3600
      GOTRUE_DB_DRIVER: postgres
      DB_NAMESPACE: auth
      API_EXTERNAL_URL: http://localhost
      GOTRUE_API_HOST: 0.0.0.0
      PORT: 9999
      GOTRUE_DISABLE_SIGNUP: "false"
      GOTRUE_SITE_URL: http://localhost
      GOTRUE_LOG_LEVEL: DEBUG
      GOTRUE_OPERATOR_TOKEN: super-secret-operator-token
      GOTRUE_EXTERNAL_PHONE_ENABLED: 'true'
      GOTRUE_MAILER_AUTOCONFIRM: "true"
      GOTRUE_SMS_AUTOCONFIRM: 'true'
      GOTRUE_SMS_PROVIDER: "twilio"

    depends_on:
      - db
    restart: unless-stopped

  db:
    image: postgres:13
    restart: unless-stopped
    ports:
      - "5432:5432"
    volumes:
      - ./GotrueTests/db:/docker-entrypoint-initdb.d/
    environment:
      POSTGRES_DB: postgres
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
      POSTGRES_PORT: 5432

Running:

curl --location --request POST 'http://localhost:9999/signup' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email": "testing@supabase.io",
    "password": "super-secure-password"
}'

Produces:

{
    "token_type": "bearer",
    "expires_in": 3600,
    "refresh_token": "08OhZcnl0ep_i1HbUVMyMQ",
   // ....
}

Then taking the refresh_token from above:

curl --location --request POST 'http://localhost:9999/token?grant_type=refresh_token' \
--header 'Content-Type: application/json' \
--data-raw '{
    "refresh_token": "08OhZcnl0ep_i1HbUVMyMQ"
}'

Produces:

null

Expected behavior

Endpoint should return a session

System information

  • Gotrue 2.3.7 (latest)
  • OS: Docker

Additional context

Ref: supabase-community/gotrue-csharp#25

@kangmingtay
Copy link
Member

fixed in #349

@acupofjose
Copy link
Author

Thanks @kangmingtay!

@osaxma
Copy link

osaxma commented Jan 30, 2022

I'm still observing the issue in v2.3.8

Screen Shot 2022-01-30 at 6 18 43 PM

@osaxma
Copy link

osaxma commented Jan 30, 2022

My bad for the noise -- i just realized the cli isn't using the latest image.

osaxma added a commit to osaxma/cli that referenced this issue Jan 30, 2022
The current go true image has a bug where refresh_token requests returns a `null` response.

supabase/auth#348
soedirgo pushed a commit to supabase/cli that referenced this issue Feb 8, 2022
The current go true image has a bug where refresh_token requests returns a `null` response.

supabase/auth#348
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants