Exemple #1
0
 public async Task <string> refreshToken(FirebaseAuthLink auth) //Function returns the authentication token
 {
     if (auth.IsExpired())                                      //Have not tested this part of the code yet as expiry takes 3600 seconds, no thanks
     {
         await auth.GetFreshAuthAsync();
     }
     return(auth.FirebaseToken);
 }
    public static void SetDetailsFromAuth()
    {
        Settings.AccessToken        = Auth.FirebaseToken;
        Settings.AccessTokenCreated = Auth.Created;
        Settings.UserId             = Auth.User.LocalId;
        Settings.UserEmail          = Auth.User.Email;
        Settings.EmailVerified      = Auth.User.IsEmailVerified;
        Settings.Authed             = !Auth.IsExpired();

        Logging.WritePluginDebug("Access token: " + Settings.AccessToken, "[Remote Control]");
        Logging.WritePluginDebug("Token created at: " + Settings.AccessTokenCreated, "[Remote Control]");
        Logging.WritePluginDebug("User id: " + Settings.UserId, "[Remote Control]");
        Logging.WritePluginDebug("User email: " + Settings.UserEmail, "[Remote Control]");
        Logging.WritePluginDebug("User verified: " + Settings.EmailVerified, "[Remote Control]");
        Logging.WritePluginDebug("Authed: " + Settings.Authed, "[Remote Control]");
    }