将autologin默认过期时间改为两个月
This commit is contained in:
parent
5c4ad1ce7d
commit
461d9cc183
|
@ -32,6 +32,8 @@ class Token < ActiveRecord::Base
|
|||
token = Token.get_token_from_user(user, 'autologin')
|
||||
unless token
|
||||
token = Token.create(:user => user, :action => 'autologin')
|
||||
else
|
||||
token..update_attribute(:created_on, Time.now)
|
||||
end
|
||||
token
|
||||
end
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
class ChangeAutologinFromSettings < ActiveRecord::Migration
|
||||
def up
|
||||
Setting.where(name: 'autologin').update_all(value: 60)
|
||||
end
|
||||
|
||||
def down
|
||||
Setting.where(name: 'autologin').update_all(value: 7)
|
||||
end
|
||||
end
|
2950
db/schema.rb
2950
db/schema.rb
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue