mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Switch to authentication using bearer token.
This commit is contained in:
parent
698d4d2687
commit
d8e831db50
8 changed files with 33 additions and 35 deletions
|
|
@ -13,6 +13,8 @@ import Icon from 'components/common/Icon';
|
|||
import Logo from 'assets/logo.svg';
|
||||
import styles from './LoginForm.module.css';
|
||||
import usePost from 'hooks/usePost';
|
||||
import { setItem } from 'lib/web';
|
||||
import { AUTH_TOKEN } from '../../lib/constants';
|
||||
|
||||
const validate = ({ username, password }) => {
|
||||
const errors = {};
|
||||
|
|
@ -39,6 +41,8 @@ export default function LoginForm() {
|
|||
});
|
||||
|
||||
if (ok) {
|
||||
setItem(AUTH_TOKEN, data.token);
|
||||
|
||||
return router.push('/');
|
||||
} else {
|
||||
setMessage(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue