Skip to content

Commit

Permalink
fix: test
Browse files Browse the repository at this point in the history
  • Loading branch information
SeungGwan123 committed Nov 25, 2024
1 parent 5ba3472 commit 7c3abfa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion packages/client/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@ import logoImage from '@asset/logo/corineeLogo.png';
import kakaLogo from '@asset/logo/kakao.png';
import googleLogo from '@asset/logo/google.png';
import { GOOGLE_AUTH_URL, KAKAO_AUTH_URL } from '@/constants/authAddress';
import { instance } from '@/api/instance';

function Header() {
const { guestLogin, logout } = useAuth();
const isAuthenticated = useAuthStore((state) => state.isAuthenticated);
const toast = useToast();

const handleLogin = (param: 'kakao' | 'google') => {
if (param === 'google') window.location.href = GOOGLE_AUTH_URL;
if (param === 'google') {
const response = instance.get(GOOGLE_AUTH_URL);
//window.location.href = GOOGLE_AUTH_URL;
}
else if (param === 'kakao') window.location.href = KAKAO_AUTH_URL;
};

Expand Down
4 changes: 2 additions & 2 deletions packages/client/src/constants/authAddress.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const KAKAO_AUTH_URL = 'https://corinee.site/api/auth/kakao';
const GOOGLE_AUTH_URL = 'https://corinee.site/api/auth/google';
const KAKAO_AUTH_URL = '/auth/kakao';
const GOOGLE_AUTH_URL = '/auth/google';

export { KAKAO_AUTH_URL, GOOGLE_AUTH_URL };
2 changes: 1 addition & 1 deletion packages/server/src/auth/strategies/google.strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export class GoogleStrategy extends PassportStrategy(Strategy, 'google') {
super({
clientID: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
callbackURL: `${process.env.CALLBACK_URL}/api/auth/google/callback`,
callbackURL: `/api/auth/google/callback`,
scope: ['email', 'profile'],
});
}
Expand Down

0 comments on commit 7c3abfa

Please sign in to comment.