Example #1
0
        public async Task<User> CreateOrUpdateUserAsync(User user)
        {
            await context.CreateTableAsync<User>();

            await context.InsertOrReplaceAsync(user);

            return user;
        }
Example #2
0
        public async Task LoginAsync(OAuthRequest oauthRequest)
        {
            var response = await traktService.LoginAsync(oauthRequest);

            var userSettings = await traktService.GetSettingsAsync();

            var user = new User
            {
                Username = userSettings.User.Username,
                AccessToken = response.Access_Token,
                Refresh_Token = response.Refresh_Token
            };

            await storageService.CreateOrUpdateUserAsync(user);
        }