I have a question related to ruby on rails. I have created two ends backend and frontend. I have added devise authentication gem for both backend and frontend. I have added user_type (1 = Admin, 2 = Normal User) attribute in user model and db. The problem is that i want to add authentication based on user type. If user type will be admin then can only access backend and if normal user then it will be able to access frontend.
I didn't find any way in devise gem to add check based on user type. The devise controllers code is very complex. Please suggest me best solution to add check based on user type.
Thanks in advance
You might want to adapt this tutorial to your needs (https://github.com/plataformatec/devise/wiki/How-To:-Add-an-Admin-Role)