Skip to content

Commit

Permalink
improve readability
Browse files Browse the repository at this point in the history
  • Loading branch information
suryabulusu committed Sep 6, 2024
1 parent 0539232 commit 503e3e8
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions src/pages/NewSignin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -383,16 +383,21 @@ export default {
* @returns {Promise<void>} A Promise that resolves once the authentication process is complete.
*/
async authenticate() {
var TESTING_MODE = false;
if (this.$store.state.authGroupData.name == "AFTesting") {
TESTING_MODE = true;
// authenticate all userIds as valid
// do not send logs to afdb
}
let isUserValid = await validateUser(
this.auth_type,
this.userInformation,
this.$store.state.authGroupData.input_schema.user_type,
this.$store.state.authGroupData.id
);
if (this.$store.state.authGroupData.name == "AFTesting") {
isUserValid.isUserIdValid = true;
}
if (TESTING_MODE == true) isUserValid.isUserIdValid = true;
var userId = "";
if (this.auth_type.includes("ID") && !isUserValid.isUserIdValid) {
Expand Down Expand Up @@ -435,13 +440,16 @@ export default {
}
if (this.enable_pop_up_form) {
await UserAPI.postUserSessionActivity(
this.userInformation["student_id"],
"sign-in",
this.$store.state.sessionData.session_id,
this.$store.state.authGroupData.input_schema.user_type,
this.$store.state.sessionData.session_occurrence_id
);
if (this.$store.state.sessionData.session_id != null && TESTING_MODE == false) {
await UserAPI.postUserSessionActivity(
this.userInformation["student_id"],
"sign-in",
this.$store.state.sessionData.session_id,
this.$store.state.authGroupData.input_schema.user_type,
this.$store.state.sessionData.session_occurrence_id
);
}
await sendSQSMessage(
"sign-in",
this.sub_type,
Expand All @@ -463,8 +471,8 @@ export default {
);
this.$router.push(`/form/${this.userInformation["student_id"]}`);
} else {
if (this.$store.state.sessionData.session_id != null && this.$store.state.authGroupData.name != "AFTesting") {
// do not send logs for reports, gurukul, aftesting authgroup
if (this.$store.state.sessionData.session_id != null && TESTING_MODE == false) {
// do not send logs for reports, gurukul, testing_mode
await UserAPI.postUserSessionActivity(
userId,
this.$store.state.sessionData.type,
Expand Down

0 comments on commit 503e3e8

Please sign in to comment.