diff --git a/README.md b/README.md index 18ec0a38..b5f49823 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/components/forms/LoginForm.js b/components/forms/LoginForm.js index 00f45a37..78e0480e 100644 --- a/components/forms/LoginForm.js +++ b/components/forms/LoginForm.js @@ -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); } }; diff --git a/package.json b/package.json index aa0c620f..4f494e65 100644 --- a/package.json +++ b/package.json @@ -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 ", "license": "MIT",