Sha256: dfb5eaabbbae9bea2391e3de07afb31c2057ae074d2242a60c30828836ad2e6c
Contents?: true
Size: 908 Bytes
Versions: 5
Compression:
Stored size: 908 Bytes
Contents
# frozen_string_literal: true module GraphqlDevise module Mutations class ConfirmRegistrationWithToken < Base argument :confirmation_token, String, required: true field :credentials, GraphqlDevise::Types::CredentialType, null: true, description: 'Authentication credentials. Null unless user is signed in after confirmation.' 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] = set_auth_headers(resource) if resource.active_for_authentication? response_payload else raise_user_error(I18n.t('graphql_devise.confirmations.invalid_token')) end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems