mirror of
https://github.com/umami-software/umami.git
synced 2025-12-06 01:18:00 +01:00
Fix error message on login.
This commit is contained in:
parent
c5d7d5dea2
commit
b905824d50
3 changed files with 5 additions and 3 deletions
|
|
@ -32,10 +32,10 @@ export default function LoginForm() {
|
|||
const handleSubmit = async ({ username, password }) => {
|
||||
const response = await post('/api/auth/login', { username, password });
|
||||
|
||||
if (response?.token) {
|
||||
if (typeof response !== 'string') {
|
||||
await Router.push('/');
|
||||
} else {
|
||||
setMessage('Incorrect username/password');
|
||||
setMessage(response.startsWith('401') ? 'Incorrect username/password' : response);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue