Skip to content

Commit

Permalink
eslint allingment fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JodhwaniMadhur committed Nov 25, 2024
1 parent 6004ad1 commit 51ae97e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion web/src/components/PasswordSignInForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const PasswordSignInForm = () => {
actionBtnLoadingState.setLoading();
await authServiceClient.signIn({ username, password, neverExpire: remember });
await userStore.fetchCurrentUser();
await userStore.updateUserSetting({ lastLoginTime: Date.parse(new Date().toISOString()) },["lastLoginTime"]);
await userStore.updateUserSetting({ lastLoginTime: Date.parse(new Date().toISOString()) }, ["lastLoginTime"]);
navigateTo("/");
} catch (error: any) {
console.error(error);
Expand Down
21 changes: 13 additions & 8 deletions web/src/pages/AuthCallback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,24 @@ const AuthCallback = () => {
});
const user = await userStore.fetchCurrentUser();
const currentDate = new Date();

const currentDateString = Date.parse(currentDate.toISOString());
if (user.sessionTimeout && user.lastLoginTime && new Date(user.lastLoginTime).getTime() + (user.sessionTimeout * 1000) < currentDateString) {
if (
user.sessionTimeout &&
user.lastLoginTime &&
new Date(user.lastLoginTime).getTime() + user.sessionTimeout * 1000 < currentDateString
) {
authServiceClient.signOut({});
navigateTo("/auth/sign-in");
}
else{
await userStore.updateUserSetting({
lastLoginTime: currentDateString,
}, ["lastLoginTime"]);
} else {
await userStore.updateUserSetting(
{
lastLoginTime: currentDateString,
},
["lastLoginTime"],
);
}


navigateTo("/");
} catch (error: any) {
console.error(error);
Expand Down

0 comments on commit 51ae97e

Please sign in to comment.