Skip to content

Commit

Permalink
add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
0xF6 committed Aug 3, 2024
1 parent d08ff74 commit a450ddf
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/logic/services/firebase/FirebaseUserService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace core.services;
using FirebaseAdmin.Auth;
using Flurl.Http;
using Google.Cloud.Firestore;
using Newtonsoft.Json;
using searchs;

public class FirebaseUserService(
Expand Down Expand Up @@ -60,10 +61,14 @@ public async Task<bool> UserAllowedPublishWorkloads()
var user = await operationBuilder.Collection("users")
.Document(me.Uid)
.GetSnapshotAsync();

logger.LogInformation($"[UserAllowedPublishWorkloads] snapshot exist : {user.Exists}");
if (!user.Exists)
return false;
var userData = user.ConvertTo<UserDetails>();
return false;
logger.LogInformation($"[UserAllowedPublishWorkloads] snapshot date : {user.CreateTime}");

var userData = user.ConvertTo<UserDetails>();

logger.LogInformation($"[UserAllowedPublishWorkloads] userData: {JsonConvert.SerializeObject(userData)}");

return userData.IsAllowedPublishWorkloads;
}
Expand Down

0 comments on commit a450ddf

Please sign in to comment.