Open
Description
Discussion
Redwood has its own self-hosted auth option now and its 💯 ! See dbAuth. I think we should completely overhaul this to "extend/merge" with dbAuth.
- We receive all the advantages(eg. session management, cookies instead of JWTs) and maintenance of
dbAuth
- We will contribute more to
dbAuth
, instead of duplicating efforts here 🦾 - Extending something that already exists, rather than making something new, is a better dev experience for both builders and maintainers
- The package would be simpler, since it can focus on only the ethereum parts of this tool
Resources
Post I wrote on how to extend dbAuth: https://community.redwoodjs.com/t/combining-dbauth-oauth2/2452
Chatting on Discord with Oliver Lance:
In effect, you are losing part of the native AuthProvider's login mechanism, since you're replacing this whole method (note the client login method is actually full lowercase):
logIn = async (options?: any) => {
this.setState({ loading: true })
const loginOutput = await this.rwClient.login(options)
await this.reauthenticate()
return loginOutput
}
To follow your extension idea, we should actually do:
const dbAuth = new AuthProvider({ type: 'dbAuth' })
dbAuth.rwClient.login = login
// OR
class AuthProviderOverride extends AuthProvider {
constructor(props) {
super(props)
this.rwClient.login = () => {
// my login override
}
}
Metadata
Metadata
Assignees
Labels
No labels