Sha256: 629a0463faf17f73fecd39c154d3f96da1154d771b95467a6a2748566e45de66

Contents?: true

Size: 1.34 KB

Versions: 1

Compression:

Stored size: 1.34 KB

Contents

# frozen_string_literal: true

module Overrides
  class ConfirmationsController < DeviseJwtAuth::ConfirmationsController
    def show
      @resource = resource_class.confirm_by_token(params[:confirmation_token])

      if @resource&.id
        # token = @resource.create_token
        # @resource.save!

        update_refresh_token_cookie
        redirect_header_options = {
          account_confirmation_success: true,
          config: params[:config],
          override_proof: '(^^,)'
        }
        redirect_headers = @resource.create_named_token_pair
                             .merge(redirect_header_options)
        redirect_to_link = DeviseJwtAuth::Url.generate(params[:redirect_url], redirect_headers)
        redirect_to redirect_to_link
        # redirect_header_options = {
        #   account_confirmation_success: true,
        #   config: params[:config],
        #   override_proof: '(^^,)'
        # }
        # redirect_headers = build_redirect_headers(token.token,
        #                                           token.client,
        #                                           redirect_header_options)
        # redirect_to(@resource.build_auth_url(params[:redirect_url],
        #                                      redirect_headers))
      else
        raise ActionController::RoutingError, 'Not Found'
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
devise_jwt_auth-0.1.6 test/dummy/app/controllers/overrides/confirmations_controller.rb