Skip to content

Commit

Permalink
Merge pull request #152 from avantifellows/feat/aftest-v2
Browse files Browse the repository at this point in the history
Move AFTesting to V2
  • Loading branch information
suryabulusu authored Sep 6, 2024
2 parents ad52e77 + 503e3e8 commit 4722644
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/pages/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ export default {
* If sessionId exists in route, then retrieve session details. Otherwise, fallback to using group data.
*/
if (this.sessionId != "") {
if (this.sessionId.startsWith("CD_Hiring") || this.sessionId.startsWith("AFTesting") || this.sessionId.startsWith("PunjabTeachers") || this.sessionId.startsWith("Candidates")) {
if (this.sessionId.startsWith("CD_Hiring") || this.sessionId.startsWith("PunjabTeachers") || this.sessionId.startsWith("Candidates")) {
this.oldFlow = true;
this.sessionData = await sessionAPIService.getOldSessionData(this.sessionId);
} else {
Expand Down
30 changes: 21 additions & 9 deletions src/pages/NewSignin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -383,13 +383,22 @@ 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 (TESTING_MODE == true) isUserValid.isUserIdValid = true;
var userId = "";
if (this.auth_type.includes("ID") && !isUserValid.isUserIdValid) {
this.invalidLoginMessage =
Expand Down Expand Up @@ -431,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 @@ -459,8 +471,8 @@ export default {
);
this.$router.push(`/form/${this.userInformation["student_id"]}`);
} else {
if (this.$store.state.sessionData.session_id != null) {
// do not send logs for reports, gurukul
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 4722644

Please sign in to comment.