Skip to content
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

feat(auth): move to Pigeon for Platform channels #10802

Merged
merged 79 commits into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
ce9e8cf
feat(auth): move to Pigeon for Platform channels
Lyokone Apr 17, 2023
7e8b5f9
feat(auth): move to Pigeon for Platform channels
Lyokone Apr 20, 2023
17ce2af
feat(auth): move to Pigeon for Platform channels
Lyokone Apr 20, 2023
d8a4ab2
feat(auth): move to Pigeon for Platform channels
Lyokone Apr 20, 2023
eb0d9bd
feat(auth): move to Pigeon for Platform channels
Lyokone Apr 20, 2023
fb53ffc
feat(auth): move to Pigeon for Platform channels
Lyokone Apr 20, 2023
5bb2b0c
feat(auth): move to Pigeon for Platform channels
Lyokone Apr 20, 2023
10735d5
feat(auth): move to Pigeon for Platform channels
Lyokone Apr 20, 2023
19f9125
feat(auth): move to Pigeon for Platform channels
Lyokone Apr 20, 2023
187cf8d
feat(auth): move to Pigeon for Platform channels
Lyokone Apr 20, 2023
5aa7dd2
feat(auth): move to Pigeon for Platform channels
Lyokone Apr 20, 2023
5ceed08
feat(auth): move to Pigeon for Platform channels
Lyokone Apr 21, 2023
cecb05c
feat(auth): move to Pigeon for Platform channels
Lyokone Apr 21, 2023
77470c2
feat(auth): move to Pigeon for Platform channels
Lyokone Apr 21, 2023
456c2f9
feat(auth): move to Pigeon for Platform channels
Lyokone Apr 21, 2023
5c9fb61
feat(auth): move to Pigeon for Platform channels END Auth
Lyokone Apr 21, 2023
1855736
feat(auth): move to Pigeon for Platform channels START user
Lyokone Apr 21, 2023
fed08b6
feat(auth): move to Pigeon for Platform channels
Lyokone Apr 21, 2023
27a99a2
feat(auth): move to Pigeon for Platform channels
Lyokone Apr 21, 2023
a67334e
feat(auth): move to Pigeon for Platform channels
Lyokone Apr 21, 2023
50a0493
feat(auth): move to Pigeon for Platform channels
Lyokone Apr 21, 2023
ee79965
feat(auth): move to Pigeon for Platform channels
Lyokone Apr 21, 2023
e606958
feat(auth): move to Pigeon for Platform channels
Lyokone Apr 24, 2023
73cd3f2
feat(auth): move to Pigeon for Platform channels
Lyokone Apr 24, 2023
e9663ce
feat(auth): move to Pigeon for Platform channels
Lyokone Apr 24, 2023
277b3e8
feat(auth): move to Pigeon for Platform channels
Lyokone Apr 24, 2023
861abd1
feat(auth): move to Pigeon for Platform channels
Lyokone Apr 24, 2023
12ad2bd
feat(auth): move to Pigeon for Platform channels
Lyokone Apr 24, 2023
6d63edb
feat: start objc
Lyokone Apr 27, 2023
daf53c0
feat: ios
Lyokone May 2, 2023
332cb5a
feat: ios
Lyokone May 2, 2023
6e94847
feat: ios
Lyokone May 2, 2023
579d062
feat: ios
Lyokone May 2, 2023
55942ae
feat: ios
Lyokone May 3, 2023
1dfc864
feat: ios
Lyokone May 3, 2023
a0c5b7e
feat: ios
Lyokone May 3, 2023
4c875e6
feat: ios
Lyokone May 4, 2023
90aeae4
feat: ios
Lyokone May 4, 2023
3e0548f
feat: ios
Lyokone May 9, 2023
52d4488
feat: ios done
Lyokone May 9, 2023
bbc6df0
feat: ios done
Lyokone May 9, 2023
3c32439
merge master
Lyokone May 9, 2023
5e92bba
remove test code from demo
Lyokone May 9, 2023
c1c62a8
fix codes
Lyokone May 10, 2023
dab3992
fix codes
Lyokone May 10, 2023
15dbbcc
fix codes
Lyokone May 10, 2023
983dfe4
feat: update web
Lyokone May 11, 2023
fc4e6ac
feat: update tests
Lyokone May 11, 2023
d98fe76
Merge branch 'master' into feat/pigeon-auth
Lyokone May 15, 2023
c88de08
fix tests
Lyokone May 16, 2023
aff9125
Merge branch 'master' of https://github.com/firebase/flutterfire into…
Lyokone May 17, 2023
993073d
add licence
Lyokone May 17, 2023
616370e
fix analyze
Lyokone May 17, 2023
66af294
fix analyze
Lyokone May 17, 2023
76a88da
fix pod projects
Lyokone May 17, 2023
05c57ba
fix macos
Lyokone May 17, 2023
5fb6ff5
fix macos
Lyokone May 17, 2023
d43ea95
fix format
Lyokone May 17, 2023
a1fae45
fix ci
Lyokone May 17, 2023
0b72b60
remove useless file
Lyokone May 17, 2023
9aa06d6
fix ios crash
Lyokone May 17, 2023
8e0dded
swift 5.6
Lyokone May 17, 2023
7e239f1
fix tests
Lyokone May 22, 2023
c63cbed
fix tests
Lyokone May 22, 2023
2210890
fix tests
Lyokone May 22, 2023
4b460d9
fix tests
Lyokone May 22, 2023
2f8fd85
fix tests
Lyokone May 22, 2023
ae5dbad
fix ci
Lyokone May 22, 2023
7d2b1c9
fix ci
Lyokone May 22, 2023
719a21d
fix android
Lyokone May 23, 2023
1b5ed85
fix format
Lyokone May 23, 2023
a83fba5
fix format
Lyokone May 23, 2023
5311882
XL runner??
Lyokone May 23, 2023
785bc31
Merge branch 'master' of https://github.com/firebase/flutterfire into…
Lyokone May 23, 2023
02d7b5e
Update packages/firebase_auth/firebase_auth/android/src/main/java/io/…
Lyokone Jun 5, 2023
6b9d984
Update packages/firebase_auth/firebase_auth/ios/Classes/FLTFirebaseAu…
Lyokone Jun 5, 2023
887cc72
remove useless code and apply suggestions from review
Lyokone Jun 6, 2023
6894958
remove useless code and apply suggestions from review
Lyokone Jun 6, 2023
923811a
Merge remote-tracking branch 'origin/master' into feat/pigeon-auth
Lyokone Jul 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,14 @@ scripts:
melos run generate:pigeon:macos --no-select && \
melos run format --no-select
packageFilters:
file-exists: 'pigeons/messages.dart'
fileExists: 'pigeons/messages.dart'
description: Generate the pigeon messages for all the supported packages.

generate:pigeon:macos:
run: |
melos exec -- "sed -i '' 's;#import <Flutter/Flutter.h>;#if TARGET_OS_OSX\n#import <FlutterMacOS/FlutterMacOS.h>\n#else\n#import <Flutter/Flutter.h>\n#endif;g' ios/Classes/messages.g.m"
packageFilters:
file-exists: 'ios/Classes/messages.g.m'
fileExists: 'ios/Classes/messages.g.m'
description: Pigeon does not add the condition to import Flutter or FlutterMacOs. Add the condition

odm:test:
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package io.flutter.plugins.firebase.auth;

import androidx.annotation.NonNull;
import com.google.android.gms.tasks.Tasks;
import com.google.firebase.FirebaseApp;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.auth.GetTokenResult;

public class FlutterFirebaseAuthUser
implements GeneratedAndroidFirebaseAuth.FirebaseAuthUserHostApi {

private FirebaseUser getCurrentUserFromPigeon(
@NonNull GeneratedAndroidFirebaseAuth.PigeonFirebaseApp pigeonApp) {
FirebaseApp app = FirebaseApp.getInstance(pigeonApp.getAppName());
FirebaseAuth auth = FirebaseAuth.getInstance(app);
if (pigeonApp.getTenantId() != null) {
auth.setTenantId(pigeonApp.getTenantId());
}

return auth.getCurrentUser();
}

@Override
public void delete(
@NonNull GeneratedAndroidFirebaseAuth.PigeonFirebaseApp app,
@NonNull GeneratedAndroidFirebaseAuth.Result<Void> result) {
try {
FirebaseUser firebaseUser = getCurrentUserFromPigeon(app);

if (firebaseUser == null) {
result.error(FlutterFirebaseAuthPluginException.noUser());
return;
}

Tasks.await(firebaseUser.delete());
result.success(null);
} catch (Exception e) {
result.error(e);
}
}

@Override
public void getIdToken(
@NonNull GeneratedAndroidFirebaseAuth.PigeonFirebaseApp app,
@NonNull Boolean forceRefresh,
@NonNull
GeneratedAndroidFirebaseAuth.Result<GeneratedAndroidFirebaseAuth.PigeonIdTokenResult>
result) {
try {
FirebaseUser firebaseUser = getCurrentUserFromPigeon(app);

if (firebaseUser == null) {
result.error(FlutterFirebaseAuthPluginException.noUser());
return;
}

GetTokenResult tokenResult = Tasks.await(firebaseUser.getIdToken(forceRefresh));
result.success(PigeonParser.parseTokenResult(tokenResult));
} catch (Exception e) {
result.error(e);
}
}
}