added changes to verify student using QR code number and password instead

This commit is contained in:
JBB0807 2025-05-05 18:49:51 -07:00
parent 4b1cb0e7f1
commit 8e1af2e846
2 changed files with 8 additions and 8 deletions

View file

@ -75,7 +75,7 @@ const AssignmentPage = () => {
formData.append("qrcodenumber", qrCodeNumber); formData.append("qrcodenumber", qrCodeNumber);
formData.append("password", password); formData.append("password", password);
formData.append("description", description); formData.append("description", description);
formData.append("intructoid", 9); formData.append("instructorid", 9);
if (file) { if (file) {
formData.append("file", file, file.name); formData.append("file", file, file.name);
} }

View file

@ -5,7 +5,7 @@ const authUrl = import.meta.env.VITE_AUTH_URL;
function SignInForm() { function SignInForm() {
const [state, setState] = React.useState({ const [state, setState] = React.useState({
assignmentID: "", qrNumber: "",
password: "", password: "",
}); });
const handleChange = (evt) => { const handleChange = (evt) => {
@ -19,8 +19,8 @@ function SignInForm() {
const handleOnSubmit = (evt) => { const handleOnSubmit = (evt) => {
evt.preventDefault(); evt.preventDefault();
const { assignmentId, password } = state; const { qrNumber, password } = state;
console.log(`You are loggind in with email: ${assignmentId} and password: ${password}`); console.log(`You are loggind in with email: ${qrNumber} and password: ${password}`);
console.log("Submitting login request with state:", state); console.log("Submitting login request with state:", state);
fetch(`${authUrl}/auth/student/login`, { fetch(`${authUrl}/auth/student/login`, {
@ -59,10 +59,10 @@ function SignInForm() {
</div> */} </div> */}
<input <input
type="assignmentId" type="number"
placeholder="Assignment ID" placeholder="Assignment QR Number"
name="assignmentId" name="qrNumber"
value={state.assignmentId} value={state.qrNumber}
onChange={handleChange} onChange={handleChange}
/> />
<input <input