fix 로그인 시 즉시 반영 안되는 버그
This commit is contained in:
1 parent
487a8ade11
commit
63e9e18719
1 file changed
+3
-1
@@ -3,7 +3,7 @@
|
|||||||
import { Suspense } from "react";
|
import { Suspense } from "react";
|
||||||
import { useRouter, useSearchParams } from "next/navigation";
|
import { useRouter, useSearchParams } from "next/navigation";
|
||||||
import GoogleSignIn from "@/components/google-sign-in";
|
import GoogleSignIn from "@/components/google-sign-in";
|
||||||
import { signIn } from "@/lib/auth";
|
import { setMe, signIn } from "@/lib/auth";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
function LoginForm() {
|
function LoginForm() {
|
||||||
@@ -20,6 +20,8 @@ function LoginForm() {
|
|||||||
<GoogleSignIn onCredential={(credential) => {
|
<GoogleSignIn onCredential={(credential) => {
|
||||||
setError(null);
|
setError(null);
|
||||||
signIn(credential)
|
signIn(credential)
|
||||||
|
// 사이드바 배지와 목록이 같은 값을 보므로 여기서 넣어줘야 같이 바뀐다
|
||||||
|
.then(setMe)
|
||||||
.then(() => router.replace(next))
|
.then(() => router.replace(next))
|
||||||
.catch((failure) => setError((failure as Error).message));
|
.catch((failure) => setError((failure as Error).message));
|
||||||
}} />
|
}} />
|
||||||
|
|||||||
Reference in new issue
Block a user