Skip to content

Commit f776c9f

Browse files
fetch user details after each successful sign in (#112)
* refresh user details after each successful sign in * bump PackageVersion to 3.5.0
1 parent fc2d811 commit f776c9f

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

src/Firebase.Auth/Firebase.Auth.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<TargetFramework>netstandard1.1</TargetFramework>
55
<PackageId>FirebaseAuthentication.net</PackageId>
6-
<PackageVersion>3.4.0</PackageVersion>
6+
<PackageVersion>3.5.0</PackageVersion>
77
<Authors>Step Up Labs, Inc.</Authors>
88
<Description>Firebase authentication library. It can generate Firebase auth token based on given OAuth token (issued by Google, Facebook...). This Firebase token can then be used with REST queries against Firebase endpoints. </Description>
99
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>

src/Firebase.Auth/FirebaseAuthProvider.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ public async Task<FirebaseAuthLink> SignInWithOAuthAsync(FirebaseAuthType authTy
102102
var providerId = this.GetProviderId(authType);
103103
var content = $"{{\"postBody\":\"access_token={oauthAccessToken}&providerId={providerId}\",\"requestUri\":\"http://localhost\",\"returnSecureToken\":true}}";
104104

105-
return await this.ExecuteWithPostContentAsync(GoogleIdentityUrl, content).ConfigureAwait(false);
105+
FirebaseAuthLink firebaseAuthLink = await this.ExecuteWithPostContentAsync(GoogleIdentityUrl, content).ConfigureAwait(false);
106+
firebaseAuthLink.User = await this.GetUserAsync(firebaseAuthLink.FirebaseToken).ConfigureAwait(false);
107+
return firebaseAuthLink;
106108
}
107109

108110
/// <summary>
@@ -117,7 +119,9 @@ public async Task<FirebaseAuthLink> SignInWithOAuthTwitterTokenAsync(string oaut
117119
var providerId = this.GetProviderId(FirebaseAuthType.Twitter);
118120
var content = $"{{\"postBody\":\"access_token={oauthAccessToken}&oauth_token_secret={oauthTokenSecret}&providerId={providerId}\",\"requestUri\":\"http://localhost\",\"returnSecureToken\":true}}";
119121

120-
return await this.ExecuteWithPostContentAsync(GoogleIdentityUrl, content).ConfigureAwait(false);
122+
FirebaseAuthLink firebaseAuthLink = await this.ExecuteWithPostContentAsync(GoogleIdentityUrl, content).ConfigureAwait(false);
123+
firebaseAuthLink.User = await this.GetUserAsync(firebaseAuthLink.FirebaseToken).ConfigureAwait(false);
124+
return firebaseAuthLink;
121125
}
122126

123127
/// <summary>
@@ -131,7 +135,9 @@ public async Task<FirebaseAuthLink> SignInWithGoogleIdTokenAsync(string idToken)
131135
var providerId = this.GetProviderId(FirebaseAuthType.Google);
132136
var content = $"{{\"postBody\":\"id_token={idToken}&providerId={providerId}\",\"requestUri\":\"http://localhost\",\"returnSecureToken\":true}}";
133137

134-
return await this.ExecuteWithPostContentAsync(GoogleIdentityUrl, content).ConfigureAwait(false);
138+
FirebaseAuthLink firebaseAuthLink = await this.ExecuteWithPostContentAsync(GoogleIdentityUrl, content).ConfigureAwait(false);
139+
firebaseAuthLink.User = await this.GetUserAsync(firebaseAuthLink.FirebaseToken).ConfigureAwait(false);
140+
return firebaseAuthLink;
135141
}
136142

137143
/// <summary>
@@ -164,7 +170,9 @@ public async Task<FirebaseAuthLink> SignInWithEmailAndPasswordAsync(string email
164170

165171
sb.Append("\"returnSecureToken\":true}}");
166172

167-
return await ExecuteWithPostContentAsync(GooglePasswordUrl, sb.ToString()).ConfigureAwait(false);
173+
FirebaseAuthLink firebaseAuthLink = await this.ExecuteWithPostContentAsync(GooglePasswordUrl, sb.ToString()).ConfigureAwait(false);
174+
firebaseAuthLink.User = await this.GetUserAsync(firebaseAuthLink.FirebaseToken).ConfigureAwait(false);
175+
return firebaseAuthLink;
168176
}
169177

170178
/// <summary>

0 commit comments

Comments
 (0)