Skip to content
This repository has been archived by the owner on May 12, 2022. It is now read-only.

Commit

Permalink
Debugging useEasybase hook in NativeAuth
Browse files Browse the repository at this point in the history
  • Loading branch information
dilan-dio4 committed Jun 4, 2021
1 parent 606faf0 commit d7fa850
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion native-example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2897,7 +2897,7 @@
"version" "0.1.2"

"easybase-react@github:easybase/easybase-react#dev":
"resolved" "git+ssh://git@github.com/easybase/easybase-react.git#3470c615f0f289ed0bab0091ceb166b76fdf3050"
"resolved" "git+ssh://git@github.com/easybase/easybase-react.git#606faf0172107d803a3f42d6919a39c5d69920a5"
"version" "2.1.15"
dependencies:
"easybasejs" "4.2.13"
Expand Down
20 changes: 13 additions & 7 deletions src/ui/NativeAuth/pages/SignIn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,20 @@ export default function ({ setCurrentPage, dictionary, toast }: INativePage) {

const onSubmit = async (formData: Record<string, string>) => {
console.log("Clicked SIGNIN, formData:", formData);
const signInRes = await signIn(formData.email, formData.password);
if (!signInRes.success) {
if (signInRes.errorCode === "NoUserExists") {
toast(dictionary.errorUserDoesNotExist!)
} else if (signInRes.errorCode === "BadFormat") {
reset();
toast(dictionary.errorBadInputFormat!)
console.log(signIn);
try {
const signInRes = await signIn(formData.email, formData.password);
console.log(signInRes);
if (!signInRes.success) {
if (signInRes.errorCode === "NoUserExists") {
toast(dictionary.errorUserDoesNotExist!)
} else if (signInRes.errorCode === "BadFormat") {
reset();
toast(dictionary.errorBadInputFormat!)
}
}
} catch (error) {
console.log("ERROR:", error);
}
// Will automatically change views
}
Expand Down

0 comments on commit d7fa850

Please sign in to comment.