diff --git a/client/src/views/TeacherLogin/CreateAccount.jsx b/client/src/views/TeacherLogin/CreateAccount.jsx index e4e6405e..db7043d6 100644 --- a/client/src/views/TeacherLogin/CreateAccount.jsx +++ b/client/src/views/TeacherLogin/CreateAccount.jsx @@ -54,7 +54,7 @@ export default function AccountCreate() { .then((response) => { setUserSession(response.data.jwt, JSON.stringify(response.data.user)); - console.log(getConfirmed()); + //console.log(getConfirmed()); setLoading(false); if (response.data.user.role.name === 'Content Creator') { @@ -81,12 +81,12 @@ export default function AccountCreate() { }; }; - console.log('Super admins:', superEmails); - console.log(superEmails[1]); + //console.log('Super admins:', superEmails); + //console.log(superEmails[1]); for (var i = 0; i < superEmails.length; i++){ sendEmailConfirmationEmail(email.value, superEmails[i]) .then(response => { - console.log('hihihi'); + //console.log('hihihi'); }) }; }) diff --git a/client/src/views/TeacherLogin/Sorry.jsx b/client/src/views/TeacherLogin/Sorry.jsx index 031a52ba..c9556eb5 100644 --- a/client/src/views/TeacherLogin/Sorry.jsx +++ b/client/src/views/TeacherLogin/Sorry.jsx @@ -1,14 +1,46 @@ -import React from "react" +import {React, useEffect} from "react" import NavBar from "../../components/NavBar/NavBar" import "./Sorry.less" +import { getSupers } from "../../Utils/AuthRequests" +import { sendEmailConfirmationEmail } from "../../Utils/requests" + export default function Sorry(props) { + const superEmails = [] + const myUser = JSON.parse(sessionStorage.user) + + useEffect( () => { + + console.log(myUser) + getSupers() + .then(response => { + //console.log(response.data) + for (var i = 0; i < response.data.length; i++){ + if (response.data[i].isActive) { + superEmails.push(response.data[i].email); + }; + //console.log(superEmails) + }; + }) + + }, []) + + const resendEmail = () => { + for (var i = 0; i < superEmails.length; i++){ + sendEmailConfirmationEmail(myUser.email, superEmails[i]) + .then(response => { + //console.log('hihihi'); + }) + } + } + return (