chore: update auth service

This commit is contained in:
Steven
2024-08-06 21:56:00 +08:00
parent e12c83137d
commit 6db8611a58
11 changed files with 377 additions and 414 deletions

View File

@ -44,7 +44,7 @@ const SignIn: React.FC = () => {
try {
actionBtnLoadingState.setLoading();
const { user } = await authServiceClient.signIn({ email, password });
const user = await authServiceClient.signIn({ email, password });
if (user) {
userStore.setCurrentUserId(user.id);
await userStore.fetchCurrentUser();

View File

@ -51,7 +51,7 @@ const SignUp: React.FC = () => {
try {
actionBtnLoadingState.setLoading();
const { user } = await authServiceClient.signUp({
const user = await authServiceClient.signUp({
email,
nickname,
password,

View File

@ -38,7 +38,7 @@ const useUserStore = create<UserState>()((set, get) => ({
return users;
},
fetchCurrentUser: async () => {
const { user } = await authServiceClient.getAuthStatus({});
const user = await authServiceClient.getAuthStatus({});
if (!user) {
throw new Error("User not found");
}