1
1
// config/authConfig.ts
2
2
3
3
import { SocialProvider } from '../types/auth' ;
4
- import { required , optional } from '../utils/envVaild' ;
4
+ import { optional , required } from '../utils/envVaild' ;
5
5
6
6
/**
7
7
* ์ธ์ฆ ๊ด๋ จ ๊ธฐ๋ณธ URL ์ค์
@@ -34,10 +34,10 @@ export const providerEnvConfig = {
34
34
} ,
35
35
// ํ์ฌ ์นด์นด์ค๋ก ์์ ์ค์
36
36
APPLE : {
37
- restApiKey : required ( 'NEXT_PUBLIC_KAKAO_REST_API_KEY ' , process . env . NEXT_PUBLIC_KAKAO_REST_API_KEY ) ,
37
+ restApiKey : required ( 'NEXT_PUBLIC_APPLE ' , process . env . NEXT_PUBLIC_APPLE_CLIENT_ID ) ,
38
38
redirectUrl : isProd
39
- ? required ( 'NEXT_PUBLIC_KAKAO_REDIRECT_URI ' , process . env . NEXT_PUBLIC_KAKAO_REDIRECT_URI )
40
- : required ( 'NEXT_PUBLIC_KAKAO_REDIRECT_URI_LOCAL ' , process . env . NEXT_PUBLIC_KAKAO_REDIRECT_URI_LOCAL ) ,
39
+ ? required ( 'NEXT_PUBLIC_APPLE_REDIRECT_URI ' , process . env . NEXT_PUBLIC_APPLE_REDIRECT_URI )
40
+ : required ( 'NEXT_PUBLIC_APPLE_REDIRECT_URI_LOCAL ' , process . env . NEXT_PUBLIC_APPLE_REDIRECT_URI_LOCAL ) ,
41
41
scope : optional ( '' ) ,
42
42
} ,
43
43
} ;
@@ -53,7 +53,7 @@ export const getRedirectUrl = (provider: SocialProvider): string => {
53
53
return providerEnvConfig . GOOGLE . redirectUrl ;
54
54
// ํ์ฌ ์นด์นด์ค๋ก ์์ ์ค์
55
55
case 'APPLE' :
56
- return providerEnvConfig . KAKAO . redirectUrl ;
56
+ return providerEnvConfig . APPLE . redirectUrl ;
57
57
default :
58
58
return '' ;
59
59
}
@@ -81,10 +81,9 @@ export const getAuthUrl = {
81
81
82
82
// ํ์ฌ ์นด์นด์ค๋ก ์์ ์ค์
83
83
APPLE : ( ) => {
84
- const { restApiKey } = providerEnvConfig . KAKAO ;
85
- const redirectUrl = getRedirectUrl ( 'KAKAO' ) ;
86
- const scope = providerEnvConfig . KAKAO . scope ;
84
+ const { restApiKey } = providerEnvConfig . APPLE ;
85
+ const redirectUrl = getRedirectUrl ( 'APPLE' ) ;
87
86
88
- return `${ AUTH_BASE_URLS . KAKAO } ?client_id=${ restApiKey } &redirect_uri=${ redirectUrl } &response_type=code&scope=${ scope } ` ;
87
+ return `${ AUTH_BASE_URLS . APPLE } ?client_id=${ restApiKey } &redirect_uri=${ redirectUrl } &response_type=code&scope=name+email&response_mode=form_post ` ;
89
88
} ,
90
89
} ;
0 commit comments