Skip to content

Commit

Permalink
Merge pull request #309 from ssu-student-union/feat/#307_council_redi…
Browse files Browse the repository at this point in the history
…rect

Feat/#307 council redirect
  • Loading branch information
jongse7 authored Nov 1, 2024
2 parents 86a0827 + 25de242 commit 96a913c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
5 changes: 4 additions & 1 deletion src/pages/general/containers/GeneralRegisterSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ export function GeneralRegisterSection({ subSection1, buttonSection }: LoginForm
});

if (response.status === 200) {
if (redirectUrl != null) {
if (redirectUrl !== null) {
if (!accessToken) {
accessToken = response.data?.data?.accessToken;
}
const separator = redirectUrl.includes('?') ? '&' : '?';
const newRedirectUrl = `${redirectUrl}${separator}accessToken=${encodeURIComponent(accessToken)}`;
localStorage.removeItem('redirectUrl');
Expand Down
18 changes: 6 additions & 12 deletions src/pages/kakao/containers/RegisterButtonSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ const handleLogin = () => {
window.location.href = KAKAO_AUTH_URL;
};

interface type {
isRedirect?: boolean;
}

export function RegisterButtonSection({ isRedirect = false }: type) {
export function RegisterButtonSection() {
return (
<div
style={{
Expand All @@ -33,13 +29,11 @@ export function RegisterButtonSection({ isRedirect = false }: type) {
<div onClick={handleLogin}>
<KakaoButton />
</div>
{!isRedirect && (
<Link to={'scouncil'}>
<div className="mt-[20px] text-[12px] font-medium not-italic leading-[130%] text-[#828282] underline">
학생자치기구 로그인
</div>
</Link>
)}
<Link to={'/register/scouncil'}>
<div className="mt-[20px] text-[12px] font-medium not-italic leading-[130%] text-[#828282] underline">
학생자치기구 로그인
</div>
</Link>
</div>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/kakao/redirect/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function KakaoRegisterRedirectPage() {
<RegisterTextSection />
</div>
<div className="z-99 absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 transform">
<RegisterButtonSection isRedirect={true} />
<RegisterButtonSection />
</div>
<div className="pointer-events-none absolute left-1/2 top-full mt-[-100px] -translate-x-1/2 -translate-y-1/2 transform">
<RegisterTextSection />
Expand Down

0 comments on commit 96a913c

Please sign in to comment.