Improve flows for social auth users (#13862)

* Multiple fixes for social authentication flows

* frontend changes

* add missing computed property

* Improvements to social flows

* fix existing email error

* minor fixes

* fix space

* fix test

* fix lint

Co-authored-by: SabreCat <sabe@habitica.com>
This commit is contained in:
Phillip Thelen
2022-03-31 23:43:16 +02:00
committed by GitHub
parent 9ff0766910
commit 55cf2f9795
19 changed files with 213 additions and 88 deletions

View File

@@ -38,6 +38,12 @@ schema.plugin(baseModel, {
plainObj.flags.newStuff = originalDoc.checkNewStuff();
}
if (plainObj.auth && plainObj.auth.local && originalDoc.auth.local.hashed_password) {
plainObj.auth.local.has_password = true;
} else if (plainObj.auth && plainObj.auth.local && originalDoc.auth.local.email) {
plainObj.auth.local.has_password = false;
}
return plainObj;
},
});