Sha256: 7ddf73f28a18449502825ba6bf9ac704250dadc81fe76c995e91446604917c04
Contents?: true
Size: 1.03 KB
Versions: 41
Compression:
Stored size: 1.03 KB
Contents
module Overrides class ConfirmationsController < DeviseTokenAuth::ConfirmationsController def show @resource = resource_class.confirm_by_token(params[:confirmation_token]) if @resource and @resource.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 @resource.tokens[client_id] = { token: token_hash, expiry: expiry } @resource.save! redirect_to(@resource.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
Version data entries
41 entries across 41 versions & 2 rubygems