Theodo-UK / nestjs-admin

A generic administration interface for TypeORM entities

Home Page:https://nestjs-admin.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Login fails after previously working fine - still works from postman

wilburluce opened this issue · comments

Running 0.4.0
I verified the admin user is still in the db
Logging in from browser just comes back with 302 back to login
I CAN post to the login URL with creds from postman and get back the home page with the list of entities
I tried in 3 browsers Chrome, Safari, Brave
I also wrote a test webapp that tried to login via axios and it also does not succeed (gets 302)

Note: what has recently changed in the App as I added Passport JWT to most of the endpoints, but i am not protecting the admin route with any guards.. but that could be a clue as to what is wrong. Im puzzled that postman works.
Any insights are much appreciated.

Update: after stepping with debugger, the admin app is actually using my apps user table for authentication not adminUser.. seems like a feature - but in my case, not what i want. will look at the docs

The plot thickens: im using a passport strategy 'local' which is apparently overwriting the same strategy used by the admin.. so that is why im able to login with my users, but not with the admin user i created. I think this is could be considered an accidental feature in that its really easy to implement your own authentication. One twist, i renamed my local strategy to 'local-md' and now i can login with both the admin user and my list of users.. that puzzles me.. i was expecting to just be able to login with the admin user.