Skip to content

Commit

Permalink
fix: DIA-1888: Followup permission fix (#7073)
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-skriabin authored Feb 13, 2025
1 parent f17f5b7 commit d491f2b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion web/libs/core/src/pages/AccountSettings/atoms/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const settingsAtom = atomWithQuery(() => ({
const result = await API.invoke("accessTokenSettings");

if (!result.$meta.ok) {
throw new Error(result.error);
return { error: true };
}

return result as AuthTokenSettings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ const tokensListAtom = atomWithQuery(() => ({
async queryFn() {
const tokens = await API.invoke("accessTokenList");
if (!tokens.$meta.ok) {
throw new Error(tokens.error);
console.error(token.error);
return [];
}

return tokens as Token[];
Expand All @@ -46,7 +47,8 @@ const refreshTokenAtom = atomWithMutation((get) => {
async mutationFn() {
const token = await API.invoke("accessTokenGetRefreshToken");
if (!token.$meta.ok) {
throw new Error(token.error);
console.error(token.error);
return "";
}
return token.token;
},
Expand Down

0 comments on commit d491f2b

Please sign in to comment.