adonis-guard icon indicating copy to clipboard operation
adonis-guard copied to clipboard

Unable to switch between auth scheme for a policy

Open toksdotdev opened this issue 4 years ago • 1 comments

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.

toksdotdev avatar Dec 11 '19 17:12 toksdotdev

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?

RomainLanz avatar Dec 18 '19 15:12 RomainLanz