mezielabs / taskist

AdonisJS 5 from scratch
https://adonismastery.com/courses/adonisjs-5-from-scratch
12 stars 11 forks source link

Unexpected exception raised from HTTP ExceptionHandler "handle" method #1

Open armgitaar opened 4 years ago

armgitaar commented 4 years ago

Thanks for these examples!

I used them while testing out deploying Adonis v5 apps with Cleaver and they were extremely helpful.

The project was running fine on my local; but then I kept getting the following error after deploying.

Unexpected exception raised from HTTP ExceptionHandler "handle" method

Stack:
Exception: Invalid guard "/login". Make sure the guard is defined inside the config/auth file
at AuthManager.makeMapping

Basically, the experience was users weren't being redirect to /loginpage.

I ended up updating the dependencies to more current and was able to repro on my local and then saw IntelliJ was giving me the hint to update redirectTo route in Auth.ts for AuthenticationException to a guard. Swapped '/login' with 'web' and, voila! All good on local and prod.

Thanks again for all of your helpful resources!

ammezie commented 4 years ago

I think there have been some changes in recent versions auth module.