Commit 772f4e70 authored by Rémy Coutable's avatar Rémy Coutable Committed by Felipe Artur

Merge branch '28808-fix-top-level-constant-referenced' into 'master'

Don't declare constants in Struct

Closes #28808

See merge request !9582
parent 1427ac19
AccessTokenValidationService = Struct.new(:token) do class AccessTokenValidationService
# Results: # Results:
VALID = :valid VALID = :valid
EXPIRED = :expired EXPIRED = :expired
REVOKED = :revoked REVOKED = :revoked
INSUFFICIENT_SCOPE = :insufficient_scope INSUFFICIENT_SCOPE = :insufficient_scope
attr_reader :token
def initialize(token)
@token = token
end
def validate(scopes: []) def validate(scopes: [])
if token.expired? if token.expired?
return EXPIRED return EXPIRED
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment