Update process phase1
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
@import bootstrap
|
||||
body
|
||||
.nav
|
||||
> li
|
||||
> li
|
||||
> a
|
||||
&:hover
|
||||
background-color: transparent
|
||||
@import bootstrap-responsive
|
||||
|
||||
+30
-1
@@ -12,7 +12,7 @@ class User
|
||||
property :oauth_expires_at
|
||||
property :auth_data
|
||||
|
||||
devise :database_authenticatable, :recoverable, :rememberable, :trackable, :token_authenticatable, :omniauthable, :omniauth_providers => [:facebook] # , :registerable
|
||||
devise :database_authenticatable, :recoverable, :rememberable, :trackable, :omniauthable, :omniauth_providers => [:facebook] #, :token_authenticatable , :registerable
|
||||
|
||||
property :authentication_token
|
||||
|
||||
@@ -58,4 +58,33 @@ class User
|
||||
def has_active_list?
|
||||
active_list_id.present?
|
||||
end
|
||||
|
||||
#####################################
|
||||
# Taken from devise 2.2
|
||||
#####################################
|
||||
|
||||
# Generate new authentication token (a.k.a. "single access token").
|
||||
def reset_authentication_token
|
||||
self.authentication_token = self.class.authentication_token
|
||||
end
|
||||
|
||||
# Generate new authentication token and save the record.
|
||||
def reset_authentication_token!
|
||||
reset_authentication_token
|
||||
save(:validate => false)
|
||||
end
|
||||
|
||||
# Generate authentication token unless already exists.
|
||||
def ensure_authentication_token
|
||||
reset_authentication_token if authentication_token.blank?
|
||||
end
|
||||
|
||||
# Generate authentication token unless already exists and save the record.
|
||||
def ensure_authentication_token!
|
||||
reset_authentication_token! if authentication_token.blank?
|
||||
end
|
||||
|
||||
def self.authentication_token
|
||||
SecureRandom.hex(24)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user