/// <inheritdoc/> public override async Task <IList <UserLoginInfo> > GetLoginsAsync(TUser user, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); ThrowIfDisposed(); user.ThrowIfNull(nameof(user)); var userLogins = await UserLoginsTable.GetLoginsAsync(user.Id); return(userLogins.Select(x => new UserLoginInfo(x.LoginProvider, x.ProviderKey, x.ProviderDisplayName)).ToList()); }
/// <inheritdoc/> public override async Task AddLoginAsync(TUser user, UserLoginInfo login, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); ThrowIfDisposed(); user.ThrowIfNull(nameof(user)); login.ThrowIfNull(nameof(login)); UserLogins ??= (await UserLoginsTable.GetLoginsAsync(user.Id)).ToList(); UserLogins.Add(CreateUserLogin(user, login)); }
/// <inheritdoc/> public override async Task RemoveLoginAsync(TUser user, string loginProvider, string providerKey, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); ThrowIfDisposed(); user.ThrowIfNull(nameof(user)); UserLogins ??= (await UserLoginsTable.GetLoginsAsync(user.Id)).ToList(); var userLogin = await FindUserLoginAsync(user.Id, loginProvider, providerKey, cancellationToken); if (userLogin != null) { UserLogins.Remove(userLogin); } }