multiple devise authentication realms in a rails application: which is the setting that allows for that? -


i've simple rails application; has devise authentication mechanism. i've added activeadmin, brings devise based authentication mechanism.

there other question , answers merging 2 models. question setting makes 2 authentication realms distinct.

example. perform login in admin page:

localhost:3000/admin 

here user model adminuser.

then try move regular (non active-admin) page:

localhost:3000/documents 

here user model user.

here, if test current_user variable, nil , not instance of adminuser. is: 2 authentication areas (i used word realm don't know if correct) kept distinct.

i've searched in activeamdin initializer, couldn't find setting contains information of creating distinct 'authentication realm'.

update 1 (and possible answer):

they not distinct.

if test current_admin_user, contains , adminuser instance.

you have 2 models user , adminuser associated 2 separate db tables, right?

do have separate aa , user model routes inside routes.rb?

finally, have set devise settings user < ar::base model (aa user model shipped activeadmin gem)

in case, authentications through user , adminuser models separated according routes set giving 'realms' asked for..

or didn't question...

current_admin_user helper gives adminuser instance

current_mega_super_user helper give megasuperuser instance (by default)


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -