Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
ed3d7d7
added dark theme variable
reeshipaul Dec 6, 2022
562e4b5
iteration2 changes
reeshipaul Dec 7, 2022
37181a4
iteration3 changes made
reeshipaul Dec 7, 2022
ab868b2
minor changes
reeshipaul Dec 14, 2022
35c8d0d
wip: register page
SomyaChawla0250 Feb 4, 2025
d17dc71
Merge branch 'somya/dev' of github.com:sdslabs/playCTF into somya/dev
Arshdeep54 Feb 4, 2025
3773fdc
fix register form with email verification
Arshdeep54 Feb 4, 2025
773ea66
fix: change register flow , and add email check
Arshdeep54 Feb 5, 2025
8183535
Merge pull request #179 from sdslabs/cosign/dev
SomyaChawla0250 Feb 5, 2025
60d945c
integrated OTP
SomyaChawla0250 Feb 5, 2025
c2fe00c
fix: add back button and error handling
Arshdeep54 Feb 6, 2025
7d138d9
Merge branch 'dark-theme-final' of github.com:sdslabs/playCTF into co…
Arshdeep54 Feb 6, 2025
dd415b0
refactor: change leaderboard logo
Arshdeep54 Feb 6, 2025
ab4c3fb
add pagination in leaderboard
Arshdeep54 Feb 12, 2025
496616b
Merge pull request #184 from sdslabs/random_fixes
sukhman-sukh Feb 12, 2025
e380f5b
add pagination in leaderboard for admin
Arshdeep54 Feb 12, 2025
16a55c4
Fixes error logging in toast
Aryan51203 Feb 12, 2025
96620fa
Remove undefined var error
Aryan51203 Feb 12, 2025
1f89710
Adds try catch for otp routes
Aryan51203 Feb 12, 2025
a1422ec
Adds forget password page and fixes error handling for otp routes
SomyaChawla0250 Feb 12, 2025
e998ff6
minor fix
SomyaChawla0250 Feb 12, 2025
3d39016
Fixes forget password route token auth
Arshdeep54 Feb 13, 2025
e907332
Merge branch 'cosign/dev' into forgot-password
Aryan51203 Feb 13, 2025
d355cbf
fixes: styling of reset password button
SomyaChawla0250 Feb 13, 2025
3b7e0e4
Merge pull request #185 from sdslabs/leaderboard-fixes
sukhman-sukh Feb 13, 2025
26d6a14
Merge pull request #187 from sdslabs/forgot-password
sukhman-sukh Feb 13, 2025
c50984b
Fix chall config
sukhman-sukh Feb 13, 2025
67eb032
Integrates route to send forgot password otp
Aryan51203 Feb 13, 2025
31c1cb5
Merge pull request #188 from sdslabs/forgot-password
Aryan51203 Feb 13, 2025
d809a5b
Fix rendering in Users and Submissions
Arshdeep54 Feb 13, 2025
4790130
Fix rendering in Challenge page
Arshdeep54 Feb 13, 2025
0afc459
Merge pull request #190 from sdslabs/admin-fixes
sukhman-sukh Feb 13, 2025
6fcf5bd
Fix user submission
Arshdeep54 Feb 13, 2025
922413d
Merge pull request #191 from sdslabs/admin-fixes
Arshdeep54 Feb 13, 2025
75181be
Fix admin link to user
Arshdeep54 Feb 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ export default {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
color: $theme-color-grey-blue;
font-size: 1vw;
overflow: hidden;
z-index: 1;
min-height: 100%;
display: flex;
background-color: #fcfcfc;
background-color: $theme-color-white;
}

@media only screen and (max-width: 1280) {
Expand Down
9 changes: 5 additions & 4 deletions src/api/admin/authAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,12 @@ export default {
},

async resetPassword(newPassword) {
const response = await this.resetPass(newPassword);
if (response.status === 200) {
return true;
try {
const response = await this.resetPass(newPassword);
return response;
} catch (error) {
throw error;
}
return false;
},

getUserInfo() {
Expand Down
68 changes: 68 additions & 0 deletions src/api/admin/otpAPI.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import axiosInstance from "../axiosInstance.js";

export default {
async sendOTP(email) {
let bodyFormData = new FormData();
bodyFormData.append("email", email);

try {
const response = await axiosInstance({
method: "post",
url: `/auth/send-otp`,
data: bodyFormData
});

return response;
} catch (error) {
throw error;
}
},
async verifyOTP(email, otp) {
let bodyFormData = new FormData();
bodyFormData.append("email", email);
bodyFormData.append("otp", otp);

try {
const response = await axiosInstance({
method: "post",
url: `/auth/verify-otp`,
data: bodyFormData,
});

return response;
} catch (error) {
throw error;
}
},
async sendOTPForForget(email) {
let bodyFormData = new FormData();
bodyFormData.append("email", email);

try {
const response = await axiosInstance({
method: "post",
url: `/auth/send-otp-forget`,
data: bodyFormData,
});
return response;
} catch (error) {
throw error;
}
},
async verifyOTPForForget(email, otp) {
let bodyFormData = new FormData();
bodyFormData.append("email", email);
bodyFormData.append("otp", otp);

try {
const response = await axiosInstance({
method: "post",
url: `/auth/verify-otp-forget`,
data: bodyFormData,
});
return response;
} catch (error) {
throw error;
}
}
};
19 changes: 14 additions & 5 deletions src/api/admin/submissionsAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ export default {
});
return submissions;
},
async getUserSubs(username) {
const response = await this.getSubmissions();
let data = response.filter(el => {
return el.username === username;

// Group submissions by username for efficient processing
groupSubmissionsByUsers(submissions, usernames) {
const userSubmissions = {};
usernames.forEach(username => {
userSubmissions[username] = submissions.filter(sub => sub.username === username);
});
return data;
return userSubmissions;
},

async fetchAsCSV() {
Expand All @@ -27,5 +29,12 @@ export default {
responseType: "blob",
url: `/api/info/submissions?format=csv`
});
},

async getUserSubs(username) {
const submissions = await this.getSubmissions();
const submission = submissions.filter(sub => sub.username === username);
console.log(submission);
return submission;
}
};
10 changes: 10 additions & 0 deletions src/api/admin/usersAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,15 @@ export default {
responseType: "blob",
url: `/api/info/users?sort=${sortFilter}&filter=${statusFilter}&format=csv`
});
},

async getLeaderboard(page = 1) {
const response = await axiosInstance.get(`/api/info/leaderboard?page=${page}`);
return response.data;
},

async getUserCount() {
const response = await axiosInstance.get('/api/info/usercount');
return response.data;
}
};
4 changes: 4 additions & 0 deletions src/api/axiosInstance.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ axiosInstance.interceptors.response.use(
let ignoreErrorPagesPath = [
"/auth/login",
"/auth/register",
"/auth/send-otp",
"/auth/reset-password",
"/auth/verify-otp",
"/auth/verify-otp-forget",
"/api/submit/challenge"
];

Expand Down
4 changes: 4 additions & 0 deletions src/assets/labs-logo-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading