- Fixed looking up invalid profiles
- Added valid error handling to bad request && rate limiting
- Add Sendgrid library (Will add SMTP later)
- Complete password reset process
This commit is contained in:
Daniel Mason 2021-04-02 01:56:08 +13:00
parent e570314ac2
commit fd615102a8
Signed by: idanoo
GPG key ID: 387387CDBC02F132
28 changed files with 871 additions and 261 deletions

View file

@ -1,7 +1,7 @@
import React, { useState, useEffect } from 'react';
import { toast } from 'react-toastify';
import AuthContext from './AuthContext';
import { PostLogin, PostRegister } from '../Api/index';
import { PostLogin, PostRegister, PostResetPassword } from '../Api/index';
const AuthContextProvider = ({ children }) => {
const [user, setUser] = useState();
@ -30,11 +30,14 @@ const AuthContextProvider = ({ children }) => {
const Register = (formValues) => {
setLoading(true);
return PostRegister(formValues).then(response => {
// Do stuff here?
setLoading(false);
});
};
const ResetPassword = (formValues) => {
return PostResetPassword(formValues)
}
const Logout = () => {
localStorage.removeItem("user");
setUser(null)
@ -47,6 +50,7 @@ const AuthContextProvider = ({ children }) => {
Logout,
Login,
Register,
ResetPassword,
loading,
user,
}}