mirror of
https://github.com/idanoo/GoScrobble
synced 2025-07-01 21:52:19 +00:00
0.0.10
- 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:
parent
e570314ac2
commit
fd615102a8
28 changed files with 871 additions and 261 deletions
|
@ -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,
|
||||
}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue