Skip to content

Commit

Permalink
Remove code related to OTP
Browse files Browse the repository at this point in the history
This removes any code related to the one time password feature for
teachers which is no longer being used anywhere.
  • Loading branch information
thomasleese committed Aug 9, 2023
1 parent 232c744 commit fb29dc9
Show file tree
Hide file tree
Showing 22 changed files with 0 additions and 487 deletions.
37 changes: 0 additions & 37 deletions adr/00010-using-email-based-otp-for-user-sign-in.md

This file was deleted.

65 changes: 0 additions & 65 deletions app/controllers/teachers/otp_controller.rb

This file was deleted.

46 changes: 0 additions & 46 deletions app/forms/teachers/otp_form.rb

This file was deleted.

36 changes: 0 additions & 36 deletions app/lib/devise/models/otp_authenticatable.rb

This file was deleted.

16 changes: 0 additions & 16 deletions app/lib/devise/otp.rb

This file was deleted.

53 changes: 0 additions & 53 deletions app/lib/devise/strategies/otp_authenticatable.rb

This file was deleted.

5 changes: 0 additions & 5 deletions app/mailers/devise_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,4 @@ def devise_mail(record, action, opts = {}, &_block)
initialize_from_record(record)
view_mail(GOVUK_NOTIFY_TEMPLATE_ID, headers_for(action, opts))
end

def otp(record, otp, opts = {})
@otp = otp
devise_mail(record, :otp, opts)
end
end
5 changes: 0 additions & 5 deletions app/models/teacher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ def application_form
application_forms.not_withdrawn.order(created_at: :desc).first
end

def send_otp(*)
otp = Devise::Otp.derive_otp(secret_key)
send_devise_notification(:otp, otp)
end

def send_magic_link(*)
token = Devise::Passwordless::LoginToken.encode(self)
send_devise_notification(:magic_link, token, {})
Expand Down
13 changes: 0 additions & 13 deletions app/views/teachers/mailer/otp.text.erb

This file was deleted.

17 changes: 0 additions & 17 deletions app/views/teachers/otp/new.html.erb

This file was deleted.

14 changes: 0 additions & 14 deletions app/views/teachers/otp/retry.html.erb

This file was deleted.

7 changes: 0 additions & 7 deletions config/initializers/devise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -320,13 +320,6 @@
# ==> Warden configuration
# If you want to use other strategies, that are not supported by Devise, or
# change the failure app, you can configure them inside the config.warden block.
config.warden do |manager|
manager.strategies.add(
:otp_authenticatable,
Devise::Strategies::OtpAuthenticatable,
)
manager.default_strategies(scope: :teacher).unshift(:otp_authenticatable)
end

#
# ==> Mountable engine configurations
Expand Down
1 change: 0 additions & 1 deletion config/initializers/filter_parameter_logging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
crypt
salt
certificate
otp
ssn
email
given_names
Expand Down
4 changes: 0 additions & 4 deletions config/locales/devise.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ en:
unauthenticated: "You need to sign in or sign up before continuing."
unconfirmed: "You have to confirm your email address before continuing."
magic_link_invalid: "Invalid or expired login link."
teacher:
otp_invalid: "Invalid code"
mailer:
confirmation_instructions:
subject: "Your QTS application link"
Expand All @@ -33,8 +31,6 @@ en:
subject: "Password Changed"
magic_link:
subject: "Confirm your email address"
otp:
subject: "Confirm your email address"
omniauth_callbacks:
failure: 'Could not authenticate you from %{kind} because "%{reason}".'
success: "Successfully authenticated from %{kind} account."
Expand Down
11 changes: 0 additions & 11 deletions config/locales/teacher_interface.en.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
en:
teachers:
otp:
retry:
expired: Your security code has expired. Try again.
exhausted: You've had too many incorrect sign in attempts. Try again.

teacher_interface:
application_forms:
show:
Expand Down Expand Up @@ -159,11 +153,6 @@ en:
activemodel:
errors:
models:
teachers/otp_form:
attributes:
otp:
blank: Enter your confirmation code
wrong_length: Enter a valid code
teacher_interface/age_range_form:
attributes:
minimum:
Expand Down
Loading

0 comments on commit fb29dc9

Please sign in to comment.