"Protect a route" question #310
Replies: 1 comment 3 replies
-
This is a business logic concern, and outside the scope of Remix Auth, you can create a function that checks the cookie and then the DB to know if the user is deactivated.
No, the Authenticator only keeps tracks of the strategies, and lets you call them, that's it, strategies can do whatever they want but their main focus is to abstract the auth flow so you don't have to implement that, and focus only on the part that's unique for your app
I never used it, but from what I saw, it seems the strategy only focus on accessing the token from the header, decoding it and gives you the claims for your to actually check your DB. |
Beta Was this translation helpful? Give feedback.
-
@sergiodxa by going back to remix-auth after a long time, now I'm I doubt on this.
Protect a route example on the README: it gets the "cookie" and if it has a "user" on it, all is fine!! Is that right?
If that user Is now "deactivated" server side (for example) ?
Also my doubt is about: the authenticator is responsible for checking if given credentials are OK right?
I've found this strategy https://github.com/takagimeow/remix-auth-jwt which only checks the given
Authorization
header, but has no logic for generating the Bearer token. I don't know if I'm misunderstanding ... or takagimeow was, on how to implement this.Again, thanks a lot!
Beta Was this translation helpful? Give feedback.
All reactions