Skip to content

Commit

Permalink
Merge pull request #113 from softeerbootcamp4th/fix/CLAP-151
Browse files Browse the repository at this point in the history
fix(CLAP-151): 공유링크로 들어간 유저가 로그인 시 뽑기권 증가 안되는 이슈
  • Loading branch information
thgee authored Aug 22, 2024
2 parents fea77e5 + b599056 commit 0ccb775
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
9 changes: 9 additions & 0 deletions packages/core/src/apis/login/apiGetLoginValid.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { customFetch, getAccessToken } from "../../utils";

export const apiGetLoginValid = () =>
customFetch(`${import.meta.env.VITE_BACK_BASE_URL}/event/lotteries/login`, {
headers: {
Authorization: `Bearer ${getAccessToken()}`,
},
credentials: "include",
});
4 changes: 2 additions & 2 deletions packages/core/src/hooks/useAuth.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { apiGetLoginValid } from "../apis/login/apiGetLoginValid";
import { initializeApp } from "firebase/app";
import {
getAuth,
GoogleAuthProvider,
reload,
signInWithPopup,
signOut,
} from "firebase/auth";
Expand Down Expand Up @@ -30,7 +30,7 @@ export const useAuth = () => {
const expirationMs = new Date(expirationTime).getTime();
localStorage.setItem("accessToken", token);
localStorage.setItem("expirationTime", String(expirationMs));
resolve({ token });
apiGetLoginValid().then(() => resolve({ token }));
})
.catch((error) => reject(error));
});
Expand Down
1 change: 0 additions & 1 deletion packages/service/src/apis/partsEvent/apiPostParts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export const apiPostParts = (): Promise<IParts> =>
`,
{
method: "POST",
credentials: "include",
headers: {
Authorization: `Bearer ${getAccessToken()}`,
},
Expand Down

0 comments on commit 0ccb775

Please sign in to comment.