Skip to content

Commit 0c0b384

Browse files
fix: Address review comments for UseUserAccessGroup
This commit incorporates feedback for the `UseUserAccessGroup` method: - Stub implementations for Android and desktop now return `kAuthErrorUnimplemented` instead of `kAuthErrorNone`. - The iOS implementation now returns `kAuthErrorUninitialized` if `auth_data_` is null. - The iOS implementation now treats an empty string for `access_group` the same as `nullptr` (passing `nil` to the Objective-C method).
1 parent a4b656f commit 0c0b384

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

auth/src/android/auth_android.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -671,8 +671,8 @@ void Auth::UseEmulator(std::string host, uint32_t port) {
671671
}
672672

673673
AuthError Auth::UseUserAccessGroup(const char* access_group) {
674-
// No-op on Android.
675-
return kAuthErrorNone;
674+
// Not implemented on Android.
675+
return kAuthErrorUnimplemented;
676676
}
677677

678678
// Not implemented for Android.

auth/src/desktop/auth_desktop.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,8 +576,8 @@ void Auth::UseEmulator(std::string host, uint32_t port) {
576576
}
577577

578578
AuthError Auth::UseUserAccessGroup(const char* access_group) {
579-
// No-op on desktop.
580-
return kAuthErrorNone;
579+
// Not implemented on desktop.
580+
return kAuthErrorUnimplemented;
581581
}
582582

583583
void InitializeTokenRefresher(AuthData* auth_data) {

auth/src/ios/auth_ios.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,11 +592,11 @@ void SignInCallback(FIRUser *_Nullable user, NSError *_Nullable error,
592592

593593
AuthError Auth::UseUserAccessGroup(const char* access_group) {
594594
if (!auth_data_) {
595-
return kAuthErrorNone; // Or appropriate error if auth_data_ is unexpectedly null
595+
return kAuthErrorUninitialized;
596596
}
597597
FIRAuth* fir_auth = AuthImpl(auth_data_);
598598
NSString* ns_access_group = nil;
599-
if (access_group) {
599+
if (access_group && strlen(access_group) > 0) {
600600
ns_access_group = [NSString stringWithUTF8String:access_group];
601601
}
602602

0 commit comments

Comments
 (0)