From ff2cbc07530d87132af09900b4d0c9ada9d3e716 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 28 Mar 2016 00:06:52 +0200 Subject: Remember me enabled by default --- app/controllers/auth/sessions_controller.rb | 8 ++++++++ app/models/user.rb | 4 ---- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/controllers/auth/sessions_controller.rb b/app/controllers/auth/sessions_controller.rb index 42b1d4ead..fe0adc9bb 100644 --- a/app/controllers/auth/sessions_controller.rb +++ b/app/controllers/auth/sessions_controller.rb @@ -1,3 +1,11 @@ class Auth::SessionsController < Devise::SessionsController + include Devise::Controllers::Rememberable + layout 'auth' + + def create + super do |resource| + remember_me(resource) + end + end end diff --git a/app/models/user.rb b/app/models/user.rb index 8b2cd22e0..a80efb50d 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -11,8 +11,4 @@ class User < ActiveRecord::Base def admin? self.admin end - - def remember_me - (super == nil) ? '1' : super - end end -- cgit