Feature: user upload artwork
This commit is contained in:
@@ -19,12 +19,12 @@ export const useAuth = () => {
|
||||
const response = await fetch('/api/users/login', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
username,
|
||||
password,
|
||||
}),
|
||||
password
|
||||
})
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
@@ -32,7 +32,7 @@ export const useAuth = () => {
|
||||
}
|
||||
|
||||
const responseData = await response.json();
|
||||
|
||||
|
||||
if (responseData.status === 'ok') {
|
||||
setUser({username, isAuthenticated: true});
|
||||
localStorage.setItem('user', JSON.stringify({username, isAuthenticated: true}));
|
||||
|
||||
Reference in New Issue
Block a user