Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Vocella <voxsim@gmail.com>2016-12-27 19:26:57 +0300
committerTiago Botelho <tiagonbotelho@hotmail.com>2017-03-01 01:15:39 +0300
commit81246e5649a8fb9e73369cbd117505a546d7e807 (patch)
treefa51d0a0d504f25bf1151db6f115e3c8a4ec8ad4 /app/models/personal_access_token.rb
parent4c4810b35b3b1729865640382b4c7e593f8b876d (diff)
manage personal_access_tokens through api
Diffstat (limited to 'app/models/personal_access_token.rb')
-rw-r--r--app/models/personal_access_token.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/personal_access_token.rb b/app/models/personal_access_token.rb
index 10a34c42fd8..5da98d7126a 100644
--- a/app/models/personal_access_token.rb
+++ b/app/models/personal_access_token.rb
@@ -1,4 +1,5 @@
class PersonalAccessToken < ActiveRecord::Base
+ include Expirable
include TokenAuthenticatable
add_authentication_token_field :token
@@ -19,4 +20,8 @@ class PersonalAccessToken < ActiveRecord::Base
self.revoked = true
self.save
end
+
+ def active?
+ !revoked? && !expired?
+ end
end