Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ public void userCallback(FirebaseUser passedUser, final Callback callback) {
this.user = passedUser;
}

this.user.getToken(true).addOnCompleteListener(new OnCompleteListener<GetTokenResult>() {
this.user.getToken(false).addOnCompleteListener(new OnCompleteListener<GetTokenResult>() {
@Override
public void onComplete(@NonNull Task<GetTokenResult> task) {
WritableMap msgMap = Arguments.createMap();
Expand Down
14 changes: 9 additions & 5 deletions ios/Firestack/FirestackAuth.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ @implementation FirestackAuth
};


[self sendJSEvent:AUTH_CHANGED_EVENT
[self sendJSEvent:AUTH_CHANGED_EVENT
props: evt];

callBack(@[evt]);
Expand All @@ -43,7 +43,7 @@ @implementation FirestackAuth
@"eventName": AUTH_ANONYMOUS_ERROR_EVENT,
@"errorMessage": ex.reason
};

[self sendJSEvent:AUTH_ERROR_EVENT
props:eventError];
NSLog(@"An exception occurred: %@", ex);
Expand Down Expand Up @@ -186,12 +186,16 @@ @implementation FirestackAuth
FIRUser *user = [FIRAuth auth].currentUser;

if (user != nil) {
NSMutableDictionary *userProps = [self userPropsFromFIRUser:user];
[userProps setValue: @((BOOL)true) forKey: @"authenticated"];
callback(@[[NSNull null], userProps]);
NSDictionary *userProps = [self userPropsFromFIRUser:user];
NSDictionary *responseProps = @{
@"authenticated": @((BOOL) true),
@"user": userProps
};
callback(@[[NSNull null], responseProps]);
} else {
// No user is signed in.
NSDictionary *err = @{
@"authenticated": @((BOOL) false),
@"user": @"No user logged in"
};
callback(@[err]);
Expand Down