13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/graphql_devise/mutations/confirm_registration_with_token.rb', line 13
def resolve(confirmation_token:)
resource = resource_class.confirm_by_token(confirmation_token)
if resource.errors.empty?
yield resource if block_given?
response_payload = { authenticatable: resource }
response_payload[:credentials] = (resource) if resource.active_for_authentication?
response_payload
else
raise_user_error(I18n.t('graphql_devise.confirmations.invalid_token'))
end
end
|