Skip to content

Conversation

@tmn
Copy link
Contributor

@tmn tmn commented Nov 5, 2022

What kind of change does this PR introduce?

Ignore SessionNotFound error on "refresh session if needed"

What is the current behavior?

gotrue-swift throws and SessionNotFound when session is not found.

What is the new behavior?

Supabase supports tables without RLS and requests to public tables without an auth session. Old behaviour prevents user to request data from database without having a valid auth session.

New behaviour will continue running the request with the application API key.

Additional context

Populate an empty Supabase project with the Countries quick start script and request data from that table:

let countryQuery = client.database.from("countries").select()
let countryResponse = try await countryQuery.execute()

if let data = try? countryResponse.decoded(to: [Country].self) {
    countries = data
}

Copy link
Contributor

@grdsdev grdsdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for that @tmn, this makes a lot of sense.

@grdsdev grdsdev merged commit 9b4880a into supabase:master Nov 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants