/// <summary> /// Deletes the user from our datastore /// </summary> /// <param name="smartMirrorUsername">The custom username id to verify which user it is in our application</param> /// <returns></returns> public async Task LogoutGoogle(string smartMirrorUsername) { _currentUser = new GoogleUserModel(); var dataStore = new FileDataStore(DataStoreLocation); await dataStore.DeleteAsync<TokenResponse>(smartMirrorUsername); DeleteSpecificUserFromDb(smartMirrorUsername); }
private void SetCurrentUser(GoogleUserModel user) { _currentUser = user; InsertUserInDb(_currentUser); }
private static void InsertUserInDb(GoogleUserModel user) { new UsersTable().InsertRow(user); }
private static GoogleUserModel ParseUserCredentials(UserCredential credential, string smartMirrorUsername, string gesture) { var user = new GoogleUserModel { accessToken = credential.Token.AccessToken, refreshToken = credential.Token.RefreshToken, name = smartMirrorUsername, uniqueGestureLeapMotion = gesture }; if (credential.Token.ExpiresInSeconds == null) return user; double expireInSeconds = (double)credential.Token.ExpiresInSeconds; user.expireDate = ConvertExpireData(expireInSeconds); return user; }