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

MatchError on update_access_token/2 prevents supabase authentication #3

Closed
zoedsoupe opened this issue Dec 14, 2024 · 0 comments · Fixed by supabase-community/supabase-ex#50 or #5
Assignees
Labels
bug Something isn't working

Comments

@zoedsoupe
Copy link
Collaborator

zoedsoupe commented Dec 14, 2024

Bug report

Describe the bug

the Supabase.GoTrue.Plug or Supabase.GoTrue.LiveView modules injects a bunch of convenience functions to leverage the Plug and LiveView aiming to provide a higher level api to integrate supabase authentication with these frameworks.

after issuing the session into supabase and returning it to the sdk, it tried to update the current scope access token for the client informed in the configuration, using the Supabase.Client.update_access_token/2 function, which used to return only :ok but now return the updated %Supabase.Client{}, that leads to a MatchError preventing to authenticate with those modules.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. use either Supabase.GoTrue.Plug or Supabase.GoTrue.LiveView modules
  2. get your supabase elixir client instance
  3. call any of log_in_with_*/2 or hooks (if live view) with sign in parameters
  4. get the MatchError while updating the current access token from the client

Expected behavior

Supabase.GoTrue.Plug and Supabase.GoTrue.LiveView injected functions should create a new supabase session

Screenshots

image

Additional context

Bug caught from a open source project that i manage and actively uses supabase elixir sdk, @peapescarte

@zoedsoupe zoedsoupe added the bug Something isn't working label Dec 14, 2024
@zoedsoupe zoedsoupe self-assigned this Dec 14, 2024
@zoedsoupe zoedsoupe linked a pull request Jan 16, 2025 that will close this issue
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
1 participant