Sha256: 6c16e3b4eaab8960d90630284d6449fa257a91326bd54dcfbbaadd583744ff09
Contents?: true
Size: 898 Bytes
Versions: 6
Compression:
Stored size: 898 Bytes
Contents
# frozen_string_literal: true module GraphqlDevise module Mutations class ConfirmRegistrationWithToken < Base argument :confirmation_token, String, required: true field :credentials, 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] = generate_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
6 entries across 6 versions & 1 rubygems