mirror of
https://github.com/umami-software/umami.git
synced 2025-12-08 05:12:36 +01:00
Replaced redux with zustand. Fixed login issue, closes #980.
This commit is contained in:
parent
7071f5fba5
commit
9937caa569
33 changed files with 234 additions and 286 deletions
|
|
@ -10,11 +10,12 @@ import FormLayout, {
|
|||
FormRow,
|
||||
} from 'components/layout/FormLayout';
|
||||
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';
|
||||
import { AUTH_TOKEN } from 'lib/constants';
|
||||
import { setUser } from 'store/app';
|
||||
import Logo from 'assets/logo.svg';
|
||||
import styles from './LoginForm.module.css';
|
||||
|
||||
const validate = ({ username, password }) => {
|
||||
const errors = {};
|
||||
|
|
@ -43,6 +44,8 @@ export default function LoginForm() {
|
|||
if (ok) {
|
||||
setItem(AUTH_TOKEN, data.token);
|
||||
|
||||
setUser(data.user);
|
||||
|
||||
return router.push('/');
|
||||
} else {
|
||||
setMessage(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue