Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Fix error message on login.

Mike Caob905824d500c
diff --git a/README.md b/README.md
index 18ec0a38e..b5f498234 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 00f45a373..78e0480ee 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 aa0c620f2..4f494e65f 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 <[email protected]>",
"license": "MIT",