mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2025-12-16 02:38:47 +00:00
Restructured Forgot Password code similar to that of Sign Up
This commit is contained in:
parent
6337422f52
commit
4623718e3a
@ -28,7 +28,6 @@ public class AuthManager {
|
||||
String password = null;
|
||||
volatile boolean waiting = false;
|
||||
|
||||
|
||||
void fetchAuthSession() throws AuthException {
|
||||
waiting = true;
|
||||
Amplify.Auth.fetchAuthSession(
|
||||
@ -61,7 +60,6 @@ public class AuthManager {
|
||||
return authSession.getUserPoolTokens().getValue().getIdToken();
|
||||
}
|
||||
|
||||
|
||||
public void setAuthSession(AuthSession toSet) {
|
||||
authSession = (AWSCognitoAuthSession) toSet;
|
||||
waiting = false;
|
||||
|
||||
@ -48,7 +48,11 @@ public class ForgotPasswordPage extends AppCompatActivity implements CodePage.Co
|
||||
}
|
||||
catch (Exception e) {
|
||||
Log.i("Authentication", e.toString());
|
||||
TextView invalidCred = findViewById(R.id.textView6);
|
||||
invalidCred.setText("Password criteria not met. Please try again.");
|
||||
return;
|
||||
}
|
||||
|
||||
openDialog();
|
||||
}
|
||||
});
|
||||
@ -64,15 +68,12 @@ public class ForgotPasswordPage extends AppCompatActivity implements CodePage.Co
|
||||
if(!cancel) {
|
||||
try {
|
||||
am.confirmPasswordReset(newPassword, code);
|
||||
Intent intent = new Intent(ForgotPasswordPage.this, LoginPage.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
catch (Exception e) {
|
||||
Log.i("Authentication", e.toString());
|
||||
TextView invalidCred = findViewById(R.id.textView6);
|
||||
invalidCred.setText("Password criteria not met. Please try again.");
|
||||
}
|
||||
}
|
||||
|
||||
Intent intent = new Intent(ForgotPasswordPage.this, LoginPage.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user