mirror of
https://github.com/gosticks/web.git
synced 2026-12-03 17:51:39 +00:00
Verify that login was successful
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
This commit is contained in:
+8
-3
@@ -42,9 +42,14 @@ export default class Login extends Component {
|
||||
hashedPassword = sha("sha256").update(hashedPassword).digest("hex");
|
||||
|
||||
api.authenticate(hashedPassword)
|
||||
.then(() => {
|
||||
// Assume it's ok since there was no error
|
||||
// TODO: verify response
|
||||
.then(data => {
|
||||
// Verify status
|
||||
if(data.status !== "success") {
|
||||
console.log("Failed to log in:");
|
||||
console.log(data);
|
||||
return;
|
||||
}
|
||||
|
||||
api.loggedIn = true;
|
||||
|
||||
// Redirect to the page the user was originally going to, or if that doesn't exist, go to home
|
||||
|
||||
Reference in New Issue
Block a user