Open pi0neerpat opened 3 years ago
Redwood has its own self-hosted auth option now and its :100: ! See dbAuth. I think we should completely overhaul this to "extend/merge" with dbAuth.
dbAuth
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 } }
Discussion on the Redwood Forums
https://community.redwoodjs.com/t/eth-auth-to-extend-dbauth/2517
Glad our discussion inspired you to improve your own integration! 🙂
Discussion
Redwood has its own self-hosted auth option now and its :100: ! See dbAuth. I think we should completely overhaul this to "extend/merge" with dbAuth.
dbAuth
dbAuth
, instead of duplicating efforts here :mechanical_arm:Resources
Post I wrote on how to extend dbAuth: https://community.redwoodjs.com/t/combining-dbauth-oauth2/2452
Chatting on Discord with Oliver Lance: