闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
545 B

  1. # frozen_string_literal: true
  2. class Auth::ChallengesController < ApplicationController
  3. include ChallengableConcern
  4. layout 'auth'
  5. before_action :authenticate_user!
  6. skip_before_action :require_functional!
  7. def create
  8. if challenge_passed?
  9. session[:challenge_passed_at] = Time.now.utc
  10. redirect_to challenge_params[:return_to]
  11. else
  12. @challenge = Form::Challenge.new(return_to: challenge_params[:return_to])
  13. flash.now[:alert] = I18n.t('challenge.invalid_password')
  14. render_challenge
  15. end
  16. end
  17. end