Cómo cerrar la sesión de un usuario si el usuario no está activo desde los últimos 15 minutos devise activeadmin

I have to logout a user(admin_user) if the user(admin_user) is not using the application for 15 minutes. How it can be done? I have tried installing activeadmin in my vendor and overriding it(putting devise.rb inside initializers folder inside vendor and write set timeout it did not work), but I don't know how that works. Please help me. I cannot write it in devise.rb as it is done via normal login(user).

Also I have one more query, how the main navigation bar can be changed in activeadmin? I need two menu one in main navigation bar and according sub navigation. Is this achievable through activeadmin?

preguntado el 28 de mayo de 14 a las 14:05

You should ask two questions for two questions you have) -

2 Respuestas

Solo uso config.timeout_in = 15.minutes en tu devise.rb initializer. Active admin has nothing to do with that.

contestado el 28 de mayo de 14 a las 14:05

Hello roman, thanks for your answer. I am using two user session for the application say user model for normal login and admin_user for admin login. what happens in that case? - madhusudhan

I don't know whether this is the correct way of getting layouts, but I found the solution creating my_navigation resource in active admin.

class MyNavigation < ActiveAdmin::Component
  def build(namespace, menu)
    if current_admin_user
    render :partial => "/layouts/admin_header"
            else
            render :partial => "/layouts/company_admin_header"
            end
        end

end

Respondido 24 Jul 14, 18:07

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.