simple auth error handling
This commit is contained in:
1 parent
78ca049794
commit
b128e4b4cd
5 files changed
+34
-1
No files matched your search
@@ -64,7 +64,7 @@ export const fetchForm = async (link, info) => {
|
||||
} catch (error) {}
|
||||
}
|
||||
|
||||
export const fetchAuth = async ({ username, password, dispatch }) => {
|
||||
export const fetchAuth = async ({ username, password, dispatch, catchError }) => {
|
||||
const baseURL = process.env.REACT_APP_BASE_URL;
|
||||
const apiURL = process.env.REACT_APP_API_URL;
|
||||
try {
|
||||
@@ -84,6 +84,7 @@ export const fetchAuth = async ({ username, password, dispatch }) => {
|
||||
)
|
||||
|
||||
if(!response.ok) {
|
||||
catchError();
|
||||
return response.statusText;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user