adonis-guard
adonis-guard copied to clipboard
Unable to switch between auth scheme for a policy
Currently, I have multiple authentication schemes setup in my application.
Unfortunately, adonis-guard keeps using the default guard for all application schemes, hence denying access during authorization. This results in the user instance in the guard to always be null for non-default schemes.
Here is the output of Guard when logged:
Guard { '$user': null }
It would be much better if we could alternate between the scheme adonis-guard uses per request.
Hey @TNkemdilim! 👋
Yes! It makes sens to be able to change how the user is retrieve for specific routes. In your opinion, how the code should looks like?