Sha256: 7e5ac195bd2b616d868aeabb8826ffaadc3b110dea047ab57afce133f3501c0e
Contents?: true
Size: 1.02 KB
Versions: 10
Compression:
Stored size: 1.02 KB
Contents
module DeviseTokenAuth class ConfirmationsController < DeviseTokenAuth::ApplicationController 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! yield if block_given? redirect_to(@resource.build_auth_url(params[:redirect_url], { token: token, client_id: client_id, account_confirmation_success: true, config: params[:config] })) else raise ActionController::RoutingError.new('Not Found') end end end end
Version data entries
10 entries across 10 versions & 1 rubygems