mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2025-12-16 10:48:46 +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;
|
String password = null;
|
||||||
volatile boolean waiting = false;
|
volatile boolean waiting = false;
|
||||||
|
|
||||||
|
|
||||||
void fetchAuthSession() throws AuthException {
|
void fetchAuthSession() throws AuthException {
|
||||||
waiting = true;
|
waiting = true;
|
||||||
Amplify.Auth.fetchAuthSession(
|
Amplify.Auth.fetchAuthSession(
|
||||||
@ -61,7 +60,6 @@ public class AuthManager {
|
|||||||
return authSession.getUserPoolTokens().getValue().getIdToken();
|
return authSession.getUserPoolTokens().getValue().getIdToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setAuthSession(AuthSession toSet) {
|
public void setAuthSession(AuthSession toSet) {
|
||||||
authSession = (AWSCognitoAuthSession) toSet;
|
authSession = (AWSCognitoAuthSession) toSet;
|
||||||
waiting = false;
|
waiting = false;
|
||||||
|
|||||||
@ -48,7 +48,11 @@ public class ForgotPasswordPage extends AppCompatActivity implements CodePage.Co
|
|||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
Log.i("Authentication", e.toString());
|
Log.i("Authentication", e.toString());
|
||||||
|
TextView invalidCred = findViewById(R.id.textView6);
|
||||||
|
invalidCred.setText("Password criteria not met. Please try again.");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
openDialog();
|
openDialog();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -64,15 +68,12 @@ public class ForgotPasswordPage extends AppCompatActivity implements CodePage.Co
|
|||||||
if(!cancel) {
|
if(!cancel) {
|
||||||
try {
|
try {
|
||||||
am.confirmPasswordReset(newPassword, code);
|
am.confirmPasswordReset(newPassword, code);
|
||||||
|
Intent intent = new Intent(ForgotPasswordPage.this, LoginPage.class);
|
||||||
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
Log.i("Authentication", e.toString());
|
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