Skip to content

Commit

Permalink
Merge pull request #42 from 2024-Saphy/fix/fix-kakao-login
Browse files Browse the repository at this point in the history
[FIX] fix kakao login
  • Loading branch information
boroboro01 authored Sep 29, 2024
2 parents 01b0fde + 1bf97f4 commit d23bde4
Show file tree
Hide file tree
Showing 9 changed files with 307 additions and 24 deletions.
18 changes: 18 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"configurations": [
{
"name": "macos-clang-arm64",
"includePath": [
"${workspaceFolder}/**"
],
"compilerPath": "/usr/bin/clang",
"cStandard": "${default}",
"cppStandard": "${default}",
"intelliSenseMode": "macos-clang-arm64",
"compilerArgs": [
""
]
}
],
"version": 4
}
13 changes: 13 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "C/C++ Runner: Debug Session",
"type": "lldb",
"request": "launch",
"args": [],
"cwd": "/Users/boroboro01/development/App",
"program": "/Users/boroboro01/development/App/build/Debug/outDebug"
}
]
}
59 changes: 59 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"C_Cpp_Runner.cCompilerPath": "clang",
"C_Cpp_Runner.cppCompilerPath": "clang++",
"C_Cpp_Runner.debuggerPath": "lldb",
"C_Cpp_Runner.cStandard": "",
"C_Cpp_Runner.cppStandard": "",
"C_Cpp_Runner.msvcBatchPath": "",
"C_Cpp_Runner.useMsvc": false,
"C_Cpp_Runner.warnings": [
"-Wall",
"-Wextra",
"-Wpedantic",
"-Wshadow",
"-Wformat=2",
"-Wcast-align",
"-Wconversion",
"-Wsign-conversion",
"-Wnull-dereference"
],
"C_Cpp_Runner.msvcWarnings": [
"/W4",
"/permissive-",
"/w14242",
"/w14287",
"/w14296",
"/w14311",
"/w14826",
"/w44062",
"/w44242",
"/w14905",
"/w14906",
"/w14263",
"/w44265",
"/w14928"
],
"C_Cpp_Runner.enableWarnings": true,
"C_Cpp_Runner.warningsAsError": false,
"C_Cpp_Runner.compilerArgs": [],
"C_Cpp_Runner.linkerArgs": [],
"C_Cpp_Runner.includePaths": [],
"C_Cpp_Runner.includeSearch": [
"*",
"**/*"
],
"C_Cpp_Runner.excludeSearch": [
"**/build",
"**/build/**",
"**/.*",
"**/.*/**",
"**/.vscode",
"**/.vscode/**"
],
"C_Cpp_Runner.useAddressSanitizer": false,
"C_Cpp_Runner.useUndefinedSanitizer": false,
"C_Cpp_Runner.useLeakSanitizer": false,
"C_Cpp_Runner.showCompilationTime": false,
"C_Cpp_Runner.useLinkTimeOptimization": false,
"C_Cpp_Runner.msvcSecureNoWarnings": false
}
32 changes: 32 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ PODS:
- FirebaseCoreInternal (10.29.0):
- "GoogleUtilities/NSData+zlib (~> 7.8)"
- Flutter (1.0.0)
- flutter_inappwebview_ios (0.0.1):
- Flutter
- flutter_inappwebview_ios/Core (= 0.0.1)
- OrderedSet (~> 6.0.3)
- flutter_inappwebview_ios/Core (0.0.1):
- Flutter
- OrderedSet (~> 6.0.3)
- flutter_native_splash (0.0.1):
- Flutter
- flutter_secure_storage (6.0.0):
Expand Down Expand Up @@ -78,6 +85,9 @@ PODS:
- GTMSessionFetcher/Core
- kakao_flutter_sdk_common (1.9.2):
- Flutter
- OrderedSet (6.0.3)
- os_info_plugin (0.0.1):
- Flutter
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
Expand All @@ -89,20 +99,28 @@ PODS:
- sqflite (0.0.3):
- Flutter
- FlutterMacOS
- tosspayments_webview_flutter (0.0.1):
- Flutter
- url_launcher_ios (0.0.1):
- Flutter
- webview_flutter_wkwebview (0.0.1):
- Flutter

DEPENDENCIES:
- firebase_auth (from `.symlinks/plugins/firebase_auth/ios`)
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
- Flutter (from `Flutter`)
- flutter_inappwebview_ios (from `.symlinks/plugins/flutter_inappwebview_ios/ios`)
- flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`)
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
- google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/darwin`)
- kakao_flutter_sdk_common (from `.symlinks/plugins/kakao_flutter_sdk_common/ios`)
- os_info_plugin (from `.symlinks/plugins/os_info_plugin/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- sqflite (from `.symlinks/plugins/sqflite/darwin`)
- tosspayments_webview_flutter (from `.symlinks/plugins/tosspayments_webview_flutter/ios`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
- webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`)

SPEC REPOS:
Expand All @@ -117,6 +135,7 @@ SPEC REPOS:
- GoogleUtilities
- GTMAppAuth
- GTMSessionFetcher
- OrderedSet
- PromisesObjC
- RecaptchaInterop

Expand All @@ -127,6 +146,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/firebase_core/ios"
Flutter:
:path: Flutter
flutter_inappwebview_ios:
:path: ".symlinks/plugins/flutter_inappwebview_ios/ios"
flutter_native_splash:
:path: ".symlinks/plugins/flutter_native_splash/ios"
flutter_secure_storage:
Expand All @@ -135,12 +156,18 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/google_sign_in_ios/darwin"
kakao_flutter_sdk_common:
:path: ".symlinks/plugins/kakao_flutter_sdk_common/ios"
os_info_plugin:
:path: ".symlinks/plugins/os_info_plugin/ios"
path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/darwin"
shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
sqflite:
:path: ".symlinks/plugins/sqflite/darwin"
tosspayments_webview_flutter:
:path: ".symlinks/plugins/tosspayments_webview_flutter/ios"
url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios"
webview_flutter_wkwebview:
:path: ".symlinks/plugins/webview_flutter_wkwebview/ios"

Expand All @@ -154,6 +181,7 @@ SPEC CHECKSUMS:
FirebaseCore: 2322423314d92f946219c8791674d2f3345b598f
FirebaseCoreInternal: df84dd300b561c27d5571684f389bf60b0a5c934
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_inappwebview_ios: 6f63631e2c62a7c350263b13fa5427aedefe81d4
flutter_native_splash: edf599c81f74d093a4daf8e17bd7a018854bc778
flutter_secure_storage: d33dac7ae2ea08509be337e775f6b59f1ff45f12
google_sign_in_ios: 07375bfbf2620bc93a602c0e27160d6afc6ead38
Expand All @@ -162,11 +190,15 @@ SPEC CHECKSUMS:
GTMAppAuth: f69bd07d68cd3b766125f7e072c45d7340dea0de
GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6
kakao_flutter_sdk_common: 049c9341e325da17ac75751a35646dbbcfa06891
OrderedSet: e539b66b644ff081c73a262d24ad552a69be3a94
os_info_plugin: d89ddf87e910a0d598fc4fc69d2b8f0f8239314f
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
RecaptchaInterop: 7d1a4a01a6b2cb1610a47ef3f85f0c411434cb21
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
tosspayments_webview_flutter: ceae304825a077de594d01ee39dd0ce2307adb4e
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
webview_flutter_wkwebview: b7e70ef1ddded7e69c796c7390ee74180182971f

PODFILE CHECKSUM: 7be2f5f74864d463a8ad433546ed1de7e0f29aef
Expand Down
2 changes: 1 addition & 1 deletion lib/service/api_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class APIService {
final dio = Dio(BaseOptions(
baseUrl: baseUrl,
contentType: contentType ?? Headers.formUrlEncodedContentType,
headers: {HttpHeaders.authorizationHeader: 'Bearer $token'}));
headers: {HttpHeaders.authorizationHeader: '$token'}));
dio.interceptors.add(logger);
switch (method) {
case DioMethod.post:
Expand Down
15 changes: 6 additions & 9 deletions lib/service/auth_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,24 @@ Future<int?> loginService(String socialType, String email) async {
);

final statusCode = response.data['status']['code'];
logger.i('Status code: $statusCode');

if (response.statusCode == 200) {
logger.i('API call [loginService] successful: ${response.data}');
final authorization = response.headers['Authorization'];
final jwt = authorization?[0].replaceFirst('Bearer ', '');
final jwt = 'Bearer ${authorization?[0]}';
await writeJwt(jwt);
logger.i('JWT : $jwt');
return statusCode;
} else if (response.statusCode == 300) {
logger.i(
'API call [loginService] successful, redirect register screen: ${response.data}');
return statusCode;
} else {
logger.i('API call [loginService] failed: ${response.statusMessage}');
logger.e('API call [loginService] failed: ${response.statusMessage}');
return statusCode;
}
} catch (e) {
logger.i('Network error occurred: $e');
throw Exception(e);
}
return null;
}

Future<int?> joinService(
Expand Down Expand Up @@ -64,10 +61,10 @@ Future<int?> joinService(
// logger.i('JWT : $jwt');
return statusCode;
} else {
logger.i('API call [loginService] failed: ${response.statusMessage}');
logger.e('API call [loginService] failed: ${response.statusMessage}');
return statusCode;
}
} catch (e) {
logger.i('Network error occurred: $e');
throw Exception(e);
}
return null;
}
Loading

0 comments on commit d23bde4

Please sign in to comment.