module Overrides class ConfirmationsController < DeviseTokenAuth::ConfirmationsController def show @user = resource_class.confirm_by_token(params[:confirmation_token]) if @user and @user.id # create client id client_id = SecureRandom.urlsafe_base64(nil, false) token = SecureRandom.urlsafe_base64(nil, false) token_hash = BCrypt::Password.create(token) expiry = (Time.now + DeviseTokenAuth.token_lifespan).to_i @user.tokens[client_id] = { token: token_hash, expiry: expiry } @user.save! redirect_to(@user.build_auth_url(params[:redirect_url], { token: token, client_id: client_id, account_confirmation_success: true, config: params[:config], override_proof: "(^^,)" })) else raise ActionController::RoutingError.new('Not Found') end end end end