Beispiel #1
0
        internal async Task <string> GetAccessToken(bool renew = false)
        {
            if (user == null)
            {
                return(null);
            }

            if (user.Expiration <= DateTimeOffset.UtcNow.AddDays(1.0) || renew)
            {
                var response = await Auth.GetAccessToken();

                if (response.Success)
                {
                    user = response.Data;
                }
                else
                {
                    user = null;
                }
            }


            return(user?.Jwt);
        }