Hi, I've been trying to figure out how to implement a "suspended" flag for users (which would, if set, prevent them from logging in and from using their API key, with a corresponding message, and would also prevent them from using an existing auth token). I'm not sure how to do that. It seems there is already something similar done when email verification is enforced and the user is not verified, but I'm not sure how to replicate this behavior with my own flag. How would I do that?
#Implement a "suspended" flag for users
3 messages · Page 1 of 1 (latest)
Help is on the way! To mark it as solved, use the /solve command. In the meantime, here are some existing threads that may help you:
Documentation:
I’m a beginner so not certain (and if it works there may still be a better way…)
I think you could use an afterLogin hook to check if the user is suspended and invalidate their login if they are.
Not sure how to implement a message to let them know though!