Skip to content

Commit bd8b5f8

Browse files
adding back accidentally deleted code and rming puts
1 parent 9ed7298 commit bd8b5f8

File tree

3 files changed

+7
-32
lines changed

3 files changed

+7
-32
lines changed

app-rails/README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,7 @@ To run natively:
9898

9999
#### Local Authentication
100100

101-
To simplify local development, you can log in using the credentials below—just make sure your environment is set to `development` and the `COGNITO_CLIENT_SECRET` is left empty:
102-
103-
```
104-
email: "dev@example.com"
105-
password: "password"
106-
```
101+
To simplify local development, you can log in using any email and password
107102

108103
#### IDE tips
109104

app-rails/app/adapters/auth/mock_adapter.rb

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ def change_email(uid, new_email)
5959
end
6060

6161
def forgot_password(email)
62+
if email.include?("UsernameExists")
63+
raise Auth::Errors::UsernameExists.new
64+
end
65+
6266
{
6367
confirmation_channel: "EMAIL"
6468
}
@@ -70,24 +74,6 @@ def confirm_forgot_password(email, code, password)
7074
end
7175
end
7276

73-
# def initiate_auth(email, password)
74-
# if email.include?("unconfirmed")
75-
# raise Auth::Errors::UserNotConfirmed.new
76-
# elsif password == "wrong"
77-
# raise Auth::Errors::InvalidCredentials.new
78-
# elsif email.include?("mfa")
79-
# return {
80-
# "challenge_name": "SOFTWARE_TOKEN_MFA",
81-
# "session": "mock-session"
82-
# }
83-
# end
84-
85-
# {
86-
# uid: @uid_generator.call,
87-
# provider: "mock"
88-
# }
89-
# end
90-
9177
def associate_software_token(access_token)
9278
"mock-secret"
9379
end

app-rails/app/controllers/users/passwords_controller.rb

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,10 @@ def forgot
88
end
99

1010
def send_reset_password_instructions
11-
12-
1311
email = params[:users_forgot_password_form][:email]
14-
puts "HERE"
15-
puts email
1612
spam_trap = params[:users_forgot_password_form][:spam_trap]
1713
@form = Users::ForgotPasswordForm.new(email: email, spam_trap: spam_trap)
18-
puts @form.invalid?
19-
puts "***********"
14+
2015
if @form.invalid?
2116
flash.now[:errors] = @form.errors.full_messages
2217
return render :forgot, status: :unprocessable_entity
@@ -28,8 +23,7 @@ def send_reset_password_instructions
2823
flash.now[:errors] = [ e.message ]
2924
return render :forgot, status: :unprocessable_entity
3025
end
31-
puts "HERE2"
32-
puts users_reset_password_path
26+
3327
redirect_to users_reset_password_path
3428
end
3529

0 commit comments

Comments
 (0)