mirror of
https://github.com/aykhans/slash-e.git
synced 2025-07-01 11:27:50 +00:00
chore: update auth service
This commit is contained in:
@ -7,7 +7,6 @@ import { authServiceClient } from "@/grpcweb";
|
||||
import useNavigateTo from "@/hooks/useNavigateTo";
|
||||
import useUserStore from "@/stores/v1/user";
|
||||
import useWorkspaceStore from "@/stores/v1/workspace";
|
||||
import { setAccessToken } from "@/utils/auth";
|
||||
import useLoading from "../hooks/useLoading";
|
||||
|
||||
const SignIn: React.FC = () => {
|
||||
@ -45,11 +44,9 @@ const SignIn: React.FC = () => {
|
||||
|
||||
try {
|
||||
actionBtnLoadingState.setLoading();
|
||||
const { user, accessToken } = await authServiceClient.signIn({ email, password });
|
||||
const { user } = await authServiceClient.signIn({ email, password });
|
||||
if (user) {
|
||||
userStore.setCurrentUserId(user.id);
|
||||
console.log("accessToken", accessToken);
|
||||
setAccessToken(accessToken);
|
||||
await userStore.fetchCurrentUser();
|
||||
navigateTo("/");
|
||||
} else {
|
||||
|
@ -7,7 +7,6 @@ import { authServiceClient } from "@/grpcweb";
|
||||
import useNavigateTo from "@/hooks/useNavigateTo";
|
||||
import useUserStore from "@/stores/v1/user";
|
||||
import useWorkspaceStore from "@/stores/v1/workspace";
|
||||
import { setAccessToken } from "@/utils/auth";
|
||||
import useLoading from "../hooks/useLoading";
|
||||
|
||||
const SignUp: React.FC = () => {
|
||||
@ -52,14 +51,13 @@ const SignUp: React.FC = () => {
|
||||
|
||||
try {
|
||||
actionBtnLoadingState.setLoading();
|
||||
const { user, accessToken } = await authServiceClient.signUp({
|
||||
const { user } = await authServiceClient.signUp({
|
||||
email,
|
||||
nickname,
|
||||
password,
|
||||
});
|
||||
if (user) {
|
||||
userStore.setCurrentUserId(user.id);
|
||||
setAccessToken(accessToken);
|
||||
await userStore.fetchCurrentUser();
|
||||
navigateTo("/");
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user