Skip to content

Commit

Permalink
fix: error message on wrong login (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
phoebus-84 authored Oct 9, 2024
1 parent ab10fe6 commit 328960a
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/lib/slangroom/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,12 @@ const slangroom = new Slangroom(pocketbase);

export const login = async (email: string, password: string) => {
const data = {
pb_address: backendUri,
pb_address: backendUri,
my_credentials: {
email,
password
}
};
try {
const res = await slangroom.execute(authenticate, {data});
return res.result.output;
} catch (e: unknown) {
log(e);
throw new Error(JSON.stringify(e));
}
const res = await slangroom.execute(authenticate, { data });
if (!res) throw new Error('Failed to login');
};

0 comments on commit 328960a

Please sign in to comment.