Remove email verification

This commit is contained in:
keannu125 2023-03-13 00:37:25 +08:00
parent 9b29f050b6
commit 3e9a8909a7
2 changed files with 6 additions and 33 deletions

View file

@ -206,19 +206,3 @@ export async function CheckSavedSession() {
console.log("No previous session found"); console.log("No previous session found");
return false; return false;
} }
export function VerifyEmail(email: string) {
return axios
.get(
"https://emailvalidation.abstractapi.com/v1/?api_key=d7abfb5f41b7476faaebe37ceba8ae37&email=" +
email
)
.then((response) => {
console.log("Email valid?" + response.data);
return true;
})
.catch((error) => {
console.log("Email valid?" + error);
return false;
});
}

View file

@ -1,14 +1,9 @@
import * as React from "react"; import * as React from "react";
import styles from "../../styles"; import styles from "../../styles";
import LoginIcon from "../../Components/Icons/LoginIcon/LoginIcon";
import { Button } from "@mui/material"; import { Button } from "@mui/material";
import { useDispatch } from "react-redux";
import { useNavigate } from "react-router-dom";
import { useState } from "react"; import { useState } from "react";
import { UserRegister, VerifyEmail } from "../../Components/Api/Api"; import { UserRegister } from "../../Components/Api/Api";
export default function Register() { export default function Register() {
const navigate = useNavigate();
const dispatch = useDispatch();
const [user, setUser] = useState({ const [user, setUser] = useState({
email: "", email: "",
username: "", username: "",
@ -65,19 +60,13 @@ export default function Register() {
style={styles.login_button} style={styles.login_button}
variant="contained" variant="contained"
onClick={async () => { onClick={async () => {
console.log("Email valid?" + (await VerifyEmail(user.email))); if (await UserRegister(user)) {
if (await VerifyEmail(user.email)) { setFeedback(
if (await UserRegister(user)) { "Registration success. Please check your email address for activation"
setFeedback( );
"Registration success. Please check your email address for activation"
);
} else {
setFeedback("Invalid credentials specified");
}
} else { } else {
setFeedback("Email does not exist"); setFeedback("Invalid credentials specified");
} }
setUser({ setUser({
email: "", email: "",
username: "", username: "",