Don't declare constants in Struct
Signed-off-by: Rémy Coutable <remy@rymai.me>
This commit is contained in:
parent
a69aa3dad5
commit
1872859dd4
|
@ -1,10 +1,16 @@
|
|||
AccessTokenValidationService = Struct.new(:token) do
|
||||
class AccessTokenValidationService
|
||||
# Results:
|
||||
VALID = :valid
|
||||
EXPIRED = :expired
|
||||
REVOKED = :revoked
|
||||
INSUFFICIENT_SCOPE = :insufficient_scope
|
||||
|
||||
attr_reader :token
|
||||
|
||||
def initialize(token)
|
||||
@token = token
|
||||
end
|
||||
|
||||
def validate(scopes: [])
|
||||
if token.expired?
|
||||
return EXPIRED
|
||||
|
|
Loading…
Reference in New Issue