Skip to content

Commit

Permalink
Update login.js
Browse files Browse the repository at this point in the history
  • Loading branch information
shrihari-prakash authored Jul 16, 2024
1 parent 25abfa4 commit 27566d0
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/public/components/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,22 @@ export default function Login() {

const onSSOComplete = async (ssoToken) => {
console.log("SSO Complete");
$.get("/sso/google/success", { ssoToken, userAgent: window.navigator.userAgent })
.done(function () {
afterLogin(configuration);
})
.fail(function () {
setIsLoggedIn(false);
onSubmitError({ errorText: i18next.t("error.invalid-login") });
});
$.ajax({
url: "/sso/google/success",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
ssoToken: ssoToken,
userAgent: window.navigator.userAgent
}),
success: function () {
afterLogin(configuration);
},
error: function () {
setIsLoggedIn(false);
onSubmitError({ errorText: i18next.t("error.invalid-login") });
}
});
};

if (isLoggedIn) {
Expand Down

0 comments on commit 27566d0

Please sign in to comment.