M
M
Megapiharb2016-10-31 00:49:09
Ruby on Rails
Megapiharb, 2016-10-31 00:49:09

How to allow only one type of user to authenticate through devise?

I have several types of users in my application (user, admin, etc.)
Authentication goes through gem devise.
How can I make it so that there is only one session? For example, I am logged in as admin and could not
log in and register as user.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
artem_music, 2016-10-31
@artem_music

As an option - when the user authorizes, close the remaining sessions of this user.

M
Megapiharb, 2016-10-31
@Megapiharb

I want to make it so that it would be impossible to authenticate to a different type of user at all. For example, I am logged in as admin and try to log in as admin, then I am sent the devise 'You are already logged in.'
I need that also when I logged in as admin and try to register as user.

J
jarosluv, 2016-11-02
@jarosluv

Limit the access rights settings to this feature for authorized users.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question