I have two React frontends for my backend: the first one is used by all users, the second one is an admin panel that can only be used by is_staff users.
What is the best way to limit access using simplejwt tokens?
I have overridden TokenObtainPairSerializer to include additional fields like 'is_staff'.
So I have two questions:
is just checking the is_staff field on the frontend safe enough? Doesn't seem to me like a good idea.
if I want to create a second API URL entry for admin authentication and override authentication logic on the backend side to only issue tokens to staff users. What method/class exactly should I override to change this? Is this a good idea?