Skip to content

Commit

Permalink
update otp_credentials_controller to redirect to new_session_path for…
Browse files Browse the repository at this point in the history
… blank challenges (resolves "undefined method root_url" error); (#75)
  • Loading branch information
strouptl authored May 25, 2024
1 parent 57e4c92 commit 960546d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ def show
@recovery = (params[:recovery] == "true") && recovery_enabled?

if @challenge.nil?
redirect_to :root
redirect_to new_session_path(resource_name)
else
self.resource = resource_class.find_valid_otp_challenge(@challenge)
if resource.nil?
redirect_to :root
redirect_to new_session_path(resource_name)
elsif @recovery
@recovery_count = resource.otp_recovery_counter
render :show
Expand Down

0 comments on commit 960546d

Please sign in to comment.