mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 07:37:11 +01:00
Refactored useApi usage.
This commit is contained in:
parent
561cde6e7e
commit
cad0b73e42
26 changed files with 67 additions and 85 deletions
|
|
@ -9,9 +9,9 @@ import {
|
|||
Icon,
|
||||
} from 'react-basics';
|
||||
import { useRouter } from 'next/router';
|
||||
import { useApi } from 'next-basics';
|
||||
import useApi from 'hooks/useApi';
|
||||
import { setUser } from 'store/app';
|
||||
import { setAuthToken } from 'lib/client';
|
||||
import { setClientAuthToken } from 'lib/client';
|
||||
import Logo from 'assets/logo.svg';
|
||||
import styles from './Form.module.css';
|
||||
|
||||
|
|
@ -23,7 +23,7 @@ export default function LoginForm() {
|
|||
const handleSubmit = async data => {
|
||||
mutate(data, {
|
||||
onSuccess: async ({ token, user }) => {
|
||||
setAuthToken(token);
|
||||
setClientAuthToken(token);
|
||||
setUser(user);
|
||||
|
||||
await router.push('/websites');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue