Sha256: 91bff32f1095679a40124d9cc9cf943eb23e2bbde449936ee565fcdb5661c53b
Contents?: true
Size: 969 Bytes
Versions: 21
Compression:
Stored size: 969 Bytes
Contents
module DeviseTokenAuth class ConfirmationsController < Devise::ConfirmationsController include Devise::Controllers::Helpers 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(@user.confirm_success_url, { token: token, client_id: client_id, account_confirmation_success: true })) else raise ActionController::RoutingError.new('Not Found') end end end end
Version data entries
21 entries across 21 versions & 1 rubygems