refactor: migrate auth service

This commit is contained in:
Steven
2024-01-29 23:12:02 +08:00
parent de8db63811
commit c5a5f67fdb
11 changed files with 314 additions and 106 deletions

View File

@ -4,6 +4,7 @@ import { toast } from "react-hot-toast";
import { Link } from "react-router-dom";
import AppearanceSelect from "@/components/AppearanceSelect";
import LocaleSelect from "@/components/LocaleSelect";
import { authServiceClient } from "@/grpcweb";
import * as api from "@/helpers/api";
import { absolutifyLink } from "@/helpers/utils";
import useLoading from "@/hooks/useLoading";
@ -75,7 +76,7 @@ const SignIn = () => {
try {
actionBtnLoadingState.setLoading();
const { data: user } = await api.signin(username, password, remember);
const { user } = await authServiceClient.signIn({ username, password, neverExpire: remember });
if (user) {
await userStore.fetchCurrentUser();
navigateTo("/");