Restructured Forgot Password code similar to that of Sign Up

This commit is contained in:
Aaron Sun 2020-10-20 20:55:02 -07:00
parent 6337422f52
commit 4623718e3a
2 changed files with 6 additions and 7 deletions

View File

@ -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;

View File

@ -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);
}
}