-
Notifications
You must be signed in to change notification settings - Fork 0
파이어베이스 전화 인증 #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
파이어베이스 전화 인증 #38
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
4f02b03
feat: firebase 연동
FLU0RITE 6679f45
feat: 전화번호 인증 기능 구현
FLU0RITE 6566118
feat: firebase 연동 및 로그인 UI 추가
FLU0RITE 93bdf5d
Merge branch 'develop' into feat/phone
FLU0RITE bbfb2f4
feat: firebase 연동 및 로그인 UI 추가
FLU0RITE 4d4c35f
feat: 전화 인증 추가
FLU0RITE 59ab3c0
chore: pr 템플릿 수정
FLU0RITE 63e0faf
chore: pr 템플릿 수정
FLU0RITE b5d6509
Merge branch 'develop' into feat/phone
FLU0RITE d88a536
Merge branch 'develop' into feat/phone
FLU0RITE 2e7a8b5
refactor: 머지 수정
FLU0RITE 3f9058b
Merge branch 'develop' into feat/phone
FLU0RITE f13d936
feat: 전화인증 UI 구현
FLU0RITE ce0771d
Merge branch 'develop' into feat/phone
FLU0RITE 80d4e4f
refactor: 파일명 수정
kkosang 6644b89
chore: pub add firestore
kkosang f77965a
feat: 전화번호 중복 체크
kkosang 45bff76
Merge branch 'develop' into feat/phone
kkosang 93d4bae
Merge branch 'develop' into feat/phone
FLU0RITE File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,4 +13,6 @@ close # | |
| ## 💬리뷰 요구사항 | ||
|
|
||
|
|
||
|
|
||
| ## 다음 작업 계획 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {"flutter":{"platforms":{"android":{"default":{"projectId":"code-l-b109b","appId":"1:971644319685:android:34198e5a313e5294b53dac","fileOutput":"android/app/google-services.json"}},"ios":{"default":{"projectId":"code-l-b109b","appId":"1:971644319685:ios:bde2639222525193b53dac","uploadDebugSymbols":false,"fileOutput":"ios/Runner/GoogleService-Info.plist"}},"dart":{"lib/firebase_options.dart":{"projectId":"code-l-b109b","configurations":{"android":"1:971644319685:android:34198e5a313e5294b53dac","ios":"1:971644319685:ios:bde2639222525193b53dac"}}}}}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,130 @@ | ||
| PODS: | ||
| - Firebase/Auth (11.10.0): | ||
| - Firebase/CoreOnly | ||
| - FirebaseAuth (~> 11.10.0) | ||
| - Firebase/CoreOnly (11.10.0): | ||
| - FirebaseCore (~> 11.10.0) | ||
| - firebase_auth (5.5.2): | ||
| - Firebase/Auth (= 11.10.0) | ||
| - firebase_core | ||
| - Flutter | ||
| - firebase_core (3.13.0): | ||
| - Firebase/CoreOnly (= 11.10.0) | ||
| - Flutter | ||
| - FirebaseAppCheckInterop (11.11.0) | ||
| - FirebaseAuth (11.10.0): | ||
| - FirebaseAppCheckInterop (~> 11.0) | ||
| - FirebaseAuthInterop (~> 11.0) | ||
| - FirebaseCore (~> 11.10.0) | ||
| - FirebaseCoreExtension (~> 11.10.0) | ||
| - GoogleUtilities/AppDelegateSwizzler (~> 8.0) | ||
| - GoogleUtilities/Environment (~> 8.0) | ||
| - GTMSessionFetcher/Core (< 5.0, >= 3.4) | ||
| - RecaptchaInterop (~> 101.0) | ||
| - FirebaseAuthInterop (11.11.0) | ||
| - FirebaseCore (11.10.0): | ||
| - FirebaseCoreInternal (~> 11.10.0) | ||
| - GoogleUtilities/Environment (~> 8.0) | ||
| - GoogleUtilities/Logger (~> 8.0) | ||
| - FirebaseCoreExtension (11.10.0): | ||
| - FirebaseCore (~> 11.10.0) | ||
| - FirebaseCoreInternal (11.10.0): | ||
| - "GoogleUtilities/NSData+zlib (~> 8.0)" | ||
| - Flutter (1.0.0) | ||
| - fluttertoast (0.0.2): | ||
| - Flutter | ||
| - GoogleUtilities/AppDelegateSwizzler (8.0.2): | ||
| - GoogleUtilities/Environment | ||
| - GoogleUtilities/Logger | ||
| - GoogleUtilities/Network | ||
| - GoogleUtilities/Privacy | ||
| - GoogleUtilities/Environment (8.0.2): | ||
| - GoogleUtilities/Privacy | ||
| - GoogleUtilities/Logger (8.0.2): | ||
| - GoogleUtilities/Environment | ||
| - GoogleUtilities/Privacy | ||
| - GoogleUtilities/Network (8.0.2): | ||
| - GoogleUtilities/Logger | ||
| - "GoogleUtilities/NSData+zlib" | ||
| - GoogleUtilities/Privacy | ||
| - GoogleUtilities/Reachability | ||
| - "GoogleUtilities/NSData+zlib (8.0.2)": | ||
| - GoogleUtilities/Privacy | ||
| - GoogleUtilities/Privacy (8.0.2) | ||
| - GoogleUtilities/Reachability (8.0.2): | ||
| - GoogleUtilities/Logger | ||
| - GoogleUtilities/Privacy | ||
| - GTMSessionFetcher/Core (4.4.0) | ||
| - kakao_flutter_sdk_common (1.9.7-3): | ||
| - Flutter | ||
| - RecaptchaInterop (101.0.0) | ||
| - screen_protector (1.2.1): | ||
| - Flutter | ||
| - ScreenProtectorKit (~> 1.3.1) | ||
| - ScreenProtectorKit (1.3.1) | ||
| - shared_preferences_foundation (0.0.1): | ||
| - Flutter | ||
| - FlutterMacOS | ||
|
|
||
| DEPENDENCIES: | ||
| - firebase_auth (from `.symlinks/plugins/firebase_auth/ios`) | ||
| - firebase_core (from `.symlinks/plugins/firebase_core/ios`) | ||
| - Flutter (from `Flutter`) | ||
| - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`) | ||
| - kakao_flutter_sdk_common (from `.symlinks/plugins/kakao_flutter_sdk_common/ios`) | ||
| - screen_protector (from `.symlinks/plugins/screen_protector/ios`) | ||
| - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) | ||
|
|
||
| SPEC REPOS: | ||
| trunk: | ||
| - Firebase | ||
| - FirebaseAppCheckInterop | ||
| - FirebaseAuth | ||
| - FirebaseAuthInterop | ||
| - FirebaseCore | ||
| - FirebaseCoreExtension | ||
| - FirebaseCoreInternal | ||
| - GoogleUtilities | ||
| - GTMSessionFetcher | ||
| - RecaptchaInterop | ||
| - ScreenProtectorKit | ||
|
|
||
| EXTERNAL SOURCES: | ||
| firebase_auth: | ||
| :path: ".symlinks/plugins/firebase_auth/ios" | ||
| firebase_core: | ||
| :path: ".symlinks/plugins/firebase_core/ios" | ||
| Flutter: | ||
| :path: Flutter | ||
| fluttertoast: | ||
| :path: ".symlinks/plugins/fluttertoast/ios" | ||
| kakao_flutter_sdk_common: | ||
| :path: ".symlinks/plugins/kakao_flutter_sdk_common/ios" | ||
| screen_protector: | ||
| :path: ".symlinks/plugins/screen_protector/ios" | ||
| shared_preferences_foundation: | ||
| :path: ".symlinks/plugins/shared_preferences_foundation/darwin" | ||
|
|
||
| SPEC CHECKSUMS: | ||
| Firebase: 1fe1c0a7d9aaea32efe01fbea5f0ebd8d70e53a2 | ||
| firebase_auth: e37065f3f80ff90580c13ad0e5a48e3bb8d2ad77 | ||
| firebase_core: 432718558359a8c08762151b5f49bb0f093eb6e0 | ||
| FirebaseAppCheckInterop: f23709c9ce92d810aa53ff4ce12ad3e666a3c7be | ||
| FirebaseAuth: c4146bdfdc87329f9962babd24dae89373f49a32 | ||
| FirebaseAuthInterop: ac22ed402c2f4e3a8c63ebd3278af9a06073c1be | ||
| FirebaseCore: 8344daef5e2661eb004b177488d6f9f0f24251b7 | ||
| FirebaseCoreExtension: 6f357679327f3614e995dc7cf3f2d600bdc774ac | ||
| FirebaseCoreInternal: ef4505d2afb1d0ebbc33162cb3795382904b5679 | ||
| Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 | ||
| fluttertoast: 21eecd6935e7064cc1fcb733a4c5a428f3f24f0f | ||
| GoogleUtilities: 26a3abef001b6533cf678d3eb38fd3f614b7872d | ||
| GTMSessionFetcher: 75b671f9e551e4c49153d4c4f8659ef4f559b970 | ||
| kakao_flutter_sdk_common: 3dc8492c202af7853585d151490b1c5c6b7576cb | ||
| RecaptchaInterop: 11e0b637842dfb48308d242afc3f448062325aba | ||
| screen_protector: 6f92086bd2f2f4b54f54913289b9d1310610140b | ||
| ScreenProtectorKit: 83a6281b02c7a5902ee6eac4f5045f674e902ae4 | ||
| shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78 | ||
|
|
||
| PODFILE CHECKSUM: f8c2dcdfb50bb67645580d28a6bf814fca30bdec | ||
|
|
||
| COCOAPODS: 1.16.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| <plist version="1.0"> | ||
| <dict> | ||
| <key>CLIENT_ID</key> | ||
| <string>971644319685-jo8kiqh779jhevlh53d3cbj3lrdavovf.apps.googleusercontent.com</string> | ||
| <key>REVERSED_CLIENT_ID</key> | ||
| <string>com.googleusercontent.apps.971644319685-jo8kiqh779jhevlh53d3cbj3lrdavovf</string> | ||
| <key>ANDROID_CLIENT_ID</key> | ||
| <string>971644319685-vnlopiq93h2n0cukes3chrm8n51t2836.apps.googleusercontent.com</string> | ||
| <key>API_KEY</key> | ||
| <string>AIzaSyA6aPcY0Qv4eCO4Q_KLxF0KMDQ9M9wdZlw</string> | ||
| <key>GCM_SENDER_ID</key> | ||
| <string>971644319685</string> | ||
| <key>PLIST_VERSION</key> | ||
| <string>1</string> | ||
| <key>BUNDLE_ID</key> | ||
| <string>com.codel.codel</string> | ||
| <key>PROJECT_ID</key> | ||
| <string>code-l-b109b</string> | ||
| <key>STORAGE_BUCKET</key> | ||
| <string>code-l-b109b.firebasestorage.app</string> | ||
| <key>IS_ADS_ENABLED</key> | ||
| <false></false> | ||
| <key>IS_ANALYTICS_ENABLED</key> | ||
| <false></false> | ||
| <key>IS_APPINVITE_ENABLED</key> | ||
| <true></true> | ||
| <key>IS_GCM_ENABLED</key> | ||
| <true></true> | ||
| <key>IS_SIGNIN_ENABLED</key> | ||
| <true></true> | ||
| <key>GOOGLE_APP_ID</key> | ||
| <string>1:971644319685:ios:bde2639222525193b53dac</string> | ||
| </dict> | ||
| </plist> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| <plist version="1.0"> | ||
| <dict> | ||
| <key>aps-environment</key> | ||
| <string>development</string> | ||
| </dict> | ||
| </plist> |
47 changes: 47 additions & 0 deletions
47
lib/auth/data/repositories/default_phone_number_repository.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| import 'dart:developer'; | ||
|
|
||
| import 'package:firebase_auth/firebase_auth.dart'; | ||
|
|
||
| import '../../domain/repositories/phone_number_repository.dart'; | ||
|
|
||
| class DefaultPhoneNumberRepository implements PhoneNumberRepository { | ||
| final FirebaseAuth _auth = FirebaseAuth.instance; | ||
|
|
||
| @override | ||
| Future<void> verifyPhoneNumber( | ||
| String phoneNumber, Function(String) onCodeSent) async { | ||
| await _auth.verifyPhoneNumber( | ||
| phoneNumber: phoneNumber, | ||
| timeout: const Duration(seconds: 120), | ||
| verificationCompleted: (PhoneAuthCredential credential) async { | ||
| log(name: 'DefaultPhoneNumberRepository : verifyPhoneNumber', '핸드폰 자동 인증 완료'); | ||
| await _auth.signInWithCredential(credential); | ||
| }, | ||
| verificationFailed: (FirebaseAuthException e) { | ||
| log(name: 'DefaultPhoneNumberRepository : verifyPhoneNumber', '인증 번호 실패: ${e.message}'); | ||
| }, | ||
| codeSent: (String verificationId, int? forceResendingToken) async { | ||
| log(name: 'DefaultPhoneNumberRepository : verifyPhoneNumber', '인증 번호 전송'); | ||
| onCodeSent(verificationId); | ||
| }, | ||
| codeAutoRetrievalTimeout: (String verificationId) { | ||
| log(name: 'DefaultPhoneNumberRepository : verifyPhoneNumber', "인증 번호 시간 초과"); | ||
| }, | ||
| ); | ||
| } | ||
|
|
||
| @override | ||
| Future<void> signInWithSmsCode(String verificationId, String smsCode) async { | ||
| try { | ||
| final credential = PhoneAuthProvider.credential( | ||
| verificationId: verificationId, | ||
| smsCode: smsCode, | ||
| ); | ||
| await _auth.signInWithCredential(credential); | ||
| log(name: 'DefaultPhoneNumberRepository : signInWithSmsCode', '로그인 성공'); | ||
| } on FirebaseAuthException catch (e) { | ||
| log(name: 'DefaultPhoneNumberRepository : signInWithSmsCode', '로그인 실패: ${e.code} - ${e.message}'); | ||
| rethrow; | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
|
|
||
| class PhoneNumber { | ||
| final String value; | ||
|
|
||
| PhoneNumber._(this.value); | ||
|
|
||
| factory PhoneNumber.fromLocal(String local) { | ||
| if (!local.startsWith('0')) { | ||
| throw FormatException("로컬 번호는 0으로 시작해야 합니다"); | ||
| } | ||
| final formatted = "+82${local.substring(1)}"; | ||
| return PhoneNumber._(formatted); | ||
| } | ||
|
|
||
| factory PhoneNumber.fromInternational(String international) { | ||
| if (!international.startsWith('+82')) { | ||
| throw FormatException("국제번호 형식이 아닙니다"); | ||
| } | ||
| return PhoneNumber._(international); | ||
| } | ||
|
|
||
| @override | ||
| String toString() => value; | ||
| } | ||
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| abstract class PhoneNumberRepository { | ||
| Future<void> verifyPhoneNumber( | ||
| String phoneNumber, Function(String) onCodeSent); | ||
| Future<void> signInWithSmsCode(String verificationId, String smsCode); | ||
| } |
Empty file.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
좋습니다 !!👍👍👍👍