DOne QAing password reset, user registration.

pull/1106/head
Rick Carlino 2019-02-06 16:46:19 -06:00
parent 79dda47fc3
commit 1821ad2ee6
3 changed files with 9 additions and 10 deletions

View File

@ -74,8 +74,8 @@ class DashboardController < ApplicationController
end
end
def verify
user = params[:token] && User.find_by!(confirmation_token: params[:token])
def confirmation_page
user = User.find_by!(confirmation_token: params.fetch(:token))
# Two use cases: re-confirmation Email change
klass = user.unconfirmed_email? ? Users::Reverify : Users::Verify
@token = klass.run!(user: user).to_json

View File

@ -1 +0,0 @@
<%# Not needed yet. %>

View File

@ -99,14 +99,14 @@ FarmBot::Application.routes.draw do
# NON-API (USER FACING) URLS:
# =======================================================================
get "/" => "dashboard#front_page", as: :front_page
get "/app" => "dashboard#main_app", as: :dashboard
get "/app/controls" => "dashboard#main_app", as: :app_landing_page
get "/tos_update" => "dashboard#tos_update", as: :tos_update
post "/csp_reports" => "dashboard#csp_reports", as: :csp_report
post "/direct_upload" => "dashboard#direct_upload", as: :direct_upload
get "/password_reset/*token" => "dashboard#password_reset", as: :password_reset
get "/verify/:token" => "dashboard#verify", as: :verify_user
match "/app/*path", to: "dashboard#main_app", via: :all, constraints: { format: "html" }
get "/tos_update" => "dashboard#tos_update", as: :tos_update
get "/password_reset/*token" => "dashboard#password_reset", as: :password_reset
get "/verify/:token" => "dashboard#confirmation_page", as: :confirmation_page
post "/csp_reports" => "dashboard#csp_reports", as: :csp_report
post "/direct_upload" => "dashboard#direct_upload", as: :direct_upload
end