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

Auth: Supabase 1.0 #1536

Merged
merged 1 commit into from
Dec 2, 2020
Merged

Auth: Supabase 1.0 #1536

merged 1 commit into from
Dec 2, 2020

Conversation

Tobbe
Copy link
Member

@Tobbe Tobbe commented Dec 2, 2020

No description provided.

@github-actions
Copy link

github-actions bot commented Dec 2, 2020

Copy link
Contributor

@dthyresson dthyresson left a comment

Choose a reason for hiding this comment

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

Great work! Just a few points for clarification, but looks good.

packages/auth/src/authClients/supabase.ts Show resolved Hide resolved

export interface AuthClientSupabase extends AuthClient {
login(options: {
email: string
password: string
}): Promise<SupabaseAuthResponse>
}): Promise<{
data: Session | null;
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not a Typescript expert, but could one define a SupabaseAuthResponse and use it both here and in signup since url and provider are optional? Both share data, user, and error.

Copy link
Member Author

Choose a reason for hiding this comment

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

Technically I could. But I don't want to. I think it would confuse people. Like "I wonder when this function would ever return url and provider?". What I'm doing here is exactly what supabase themselves are doing as well.

packages/api/src/auth/decoders/supabase.ts Show resolved Hide resolved
@dthyresson
Copy link
Contributor

@Tobbe unless you want others to review, I think is good to merge. 🎉

Next steps are:

  • Update docs to require the SUPABASE_JWT_SECRET and where to find it in Supabase
  • Make @thedavidprice aware that this is a breaking change for release notes
  • Update auth playground
  • Let's open two issues:one for magiclink support and one other for the OAuth provider support

@Tobbe
Copy link
Member Author

Tobbe commented Dec 2, 2020

  • Update docs to require the SUPABASE_JWT_SECRET and where to find it in Supabase

https://github.com/redwoodjs/redwoodjs.com/issues/478

  • Make @thedavidprice aware that this is a breaking change for release notes

@thedavidprice Consider yourself notified 🙂

  • Update auth playground

Added a comment to existing issue redwoodjs/playground-auth#11

  • Let's open two issues:one for magiclink support and one other for the OAuth provider support

OAuth: #1537
MagicLink: #1538

@Tobbe Tobbe mentioned this pull request Dec 2, 2020
@Tobbe
Copy link
Member Author

Tobbe commented Dec 2, 2020

@kiwicopple If you find your way over here, these are the import lines I was talking about

import { Session, User, Provider } from '@supabase/gotrue-js/dist/main/lib/types'
import type SupabaseClient from '@supabase/supabase-js/dist/main/SupabaseClient'

Is there a cleaner way to get at those types?

@Tobbe Tobbe added release:breaking This PR is a breaking change next release labels Dec 2, 2020
@thedavidprice thedavidprice added this to the Next Release milestone Dec 3, 2020
@kiwicopple
Copy link

Hey @Tobbe sorry for the delay - I saw this but it was right before we did our Beta launch and I've been swamped.

They types are now exported, which from the auth library and from supabase-js

Should make it a lot easier to import them now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:breaking This PR is a breaking change topic/auth
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade Supabase in auth package to supabase-js version 1.0
4 participants