Fix error message on login.

This commit is contained in:
Mike Cao 2020-08-19 19:03:42 -07:00
parent c5d7d5dea2
commit b905824d50
3 changed files with 5 additions and 3 deletions

View File

@ -48,6 +48,8 @@ For Postgresql:
psql -h hostname -U username -d databasename -f sql/schema.postgresql.sql
```
This will also create a login account with username **admin** and password **umami**.
### Configure umami
Create an `.env` file with the following

View File

@ -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);
}
};

View File

@ -1,6 +1,6 @@
{
"name": "umami",
"version": "0.10.1",
"version": "0.10.2",
"description": "A simple, fast, website analytics alternative to Google Analytics. ",
"author": "Mike Cao <mike@mikecao.com>",
"license": "MIT",