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 (

Hey! Looks like your account is not confirmed. Please ask a "STRAPI SUPER ADMIN" to check their email for a confirmation code.

+

If you wish to resend a confirmation email, click here

diff --git a/server/extensions/documentation/documentation/1.0.0/full_documentation.json b/server/extensions/documentation/documentation/1.0.0/full_documentation.json index 7eb7bcb9..16f7e733 100755 --- a/server/extensions/documentation/documentation/1.0.0/full_documentation.json +++ b/server/extensions/documentation/documentation/1.0.0/full_documentation.json @@ -14,7 +14,7 @@ "name": "Apache 2.0", "url": "https://www.apache.org/licenses/LICENSE-2.0.html" }, - "x-generation-date": "04/28/2024 5:57:00 PM" + "x-generation-date": "05/03/2024 5:18:24 PM" }, "x-strapi-config": { "path": "/documentation",