Skip to content

Commit a4a115f

Browse files
Parity in response format between ios and android
1 parent 972b16d commit a4a115f

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

android/src/main/java/io/fullstack/firestack/FirestackAuth.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,6 @@ public void onComplete(@NonNull Task<GetTokenResult> task) {
432432
WritableMap userMap = getUserMap();
433433
if (FirestackAuthModule.this.user != null) {
434434
final String token = task.getResult().getToken();
435-
436435
userMap.putString("token", token);
437436
userMap.putBoolean("anonymous", false);
438437
}
@@ -509,9 +508,10 @@ private WritableMap getUserMap() {
509508
userMap.putString("email", email);
510509
userMap.putString("uid", uid);
511510
userMap.putString("providerId", provider);
511+
userMap.putBoolean("emailVerified", user.isEmailVerified());
512512

513513
if (name != null) {
514-
userMap.putString("name", name);
514+
userMap.putString("displayName", name);
515515
}
516516

517517
if (photoUrl != null) {

ios/Firestack/FirestackAuth.m

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ @implementation FirestackAuth
2525
if (!user) {
2626
NSDictionary *evt = @{
2727
@"eventName": AUTH_ANONYMOUS_ERROR_EVENT,
28-
@"msg": [error localizedDescription]
28+
@"errorMessage": [error localizedDescription]
2929
};
3030

3131

@@ -41,7 +41,7 @@ @implementation FirestackAuth
4141
} @catch(NSException *ex) {
4242
NSDictionary *eventError = @{
4343
@"eventName": AUTH_ANONYMOUS_ERROR_EVENT,
44-
@"msg": ex.reason
44+
@"errorMessage": ex.reason
4545
};
4646

4747
[self sendJSEvent:AUTH_ERROR_EVENT
@@ -144,14 +144,15 @@ @implementation FirestackAuth
144144
sendJSEvent:AUTH_CHANGED_EVENT
145145
props: @{
146146
@"eventName": @"userTokenError",
147-
@"msg": [error localizedFailureReason]
147+
@"authenticated": @((BOOL)true),
148+
@"errorMessage": [error localizedFailureReason]
148149
}];
149150
} else {
150151
[self
151152
sendJSEvent:AUTH_CHANGED_EVENT
152153
props: @{
153154
@"eventName": @"user",
154-
@"authenticated": @(true),
155+
@"authenticated": @((BOOL)true),
155156
@"user": userProps
156157
}];
157158
}
@@ -164,7 +165,7 @@ @implementation FirestackAuth
164165
[self sendJSEvent:AUTH_CHANGED_EVENT
165166
props:@{
166167
@"eventName": @"no_user",
167-
@"authenticated": @(false),
168+
@"authenticated": @((BOOL)false),
168169
@"error": err
169170
}];
170171
}

0 commit comments

Comments
 (0)