Sha256: 0c71b43b25a7581a7efc37da236fcfba6d12a8b60a2e46101dff1f560810027d
Contents?: true
Size: 987 Bytes
Versions: 15
Compression:
Stored size: 987 Bytes
Contents
module DeviseTokenAuth class ConfirmationsController < DeviseTokenAuth::ApplicationController 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] })) else raise ActionController::RoutingError.new('Not Found') end end end end
Version data entries
15 entries across 15 versions & 2 rubygems