Sha256: 7df174452df94fa0bb6ac2a2f63bdd4e07baa797b99760ad94ed0b76cf5312e9

Contents?: true

Size: 1.36 KB

Versions: 6

Compression:

Stored size: 1.36 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 && @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

6 entries across 6 versions & 1 rubygems

Version Path
devise_jwt_auth-0.1.5 test/dummy/app/controllers/overrides/confirmations_controller.rb
devise_jwt_auth-0.1.4 test/dummy/app/controllers/overrides/confirmations_controller.rb
devise_jwt_auth-0.1.3 test/dummy/app/controllers/overrides/confirmations_controller.rb
devise_jwt_auth-0.1.2 test/dummy/app/controllers/overrides/confirmations_controller.rb
devise_jwt_auth-0.1.1 test/dummy/app/controllers/overrides/confirmations_controller.rb
devise_jwt_auth-0.1.0 test/dummy/app/controllers/overrides/confirmations_controller.rb