I am working on an app in which there is a model User with roles member and Admin.
As per requirement, I have to made two separate login pages for roles of Admin and Member.
with http://localhost:3000/admin/admin_login
it goes to admin login page and with
http://localhost:3000/users/sign_in
it goes to member login page.
Somehow I managed to route according scenerio, after sign_in and sigout to respective admin panel or normal website for member.
But Now there is issue that when login fails it redirect it to http://localhost:3000/users/sign_in
even if in admin case.
Is there a way that I can know, From where this request is generated either from
/admin
or /users/sign_in
?
So that I can redirect them to respective page
Aucun commentaire:
Enregistrer un commentaire