Class: Mutations::Authentication::ValidateToken
- Inherits:
-
GraphQL::Schema::Mutation
- Object
- GraphQL::Schema::Mutation
- Mutations::Authentication::ValidateToken
show all
- Includes:
- Graphql::AccountLockHelper
- Defined in:
- app/graphql/mutations/authentication/validate_token.rb
Instance Method Summary
collapse
#account_locked?, #lockable?
Instance Method Details
#resolve ⇒ Object
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'app/graphql/mutations/authentication/validate_token.rb', line 11
def resolve
user = context[:current_user]
if user.present? && !account_locked?(user)
{
errors: [],
success: true,
user: user,
valid: true
}
else
{
errors: [],
success: false,
user: nil,
valid: false
}
end
end
|