提交 ad00b9bc 编写于 作者: R Rémy Coutable

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

Don't declare constants in Struct

Closes #28808

See merge request !9582
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册