public async Task <GetExternalLoginsQueryResult> Handle(GetExternalLoginsQuery query, CancellationToken token) { var externalLogins = await _externalLoginService.GetExternalLogins(); return(new GetExternalLoginsQueryResult() { ExternalLogins = externalLogins }); }
public async Task <GetUserExternalLoginsQueryResult> Handle(GetUserExternalLoginsQuery query, CancellationToken token) { var externalLogins = await _externalLoginService.GetExternalLogins(); var userExternalLogins = await _userExternalLoginService.GetUserExternalLogins(query.User); var otherExternalLogins = externalLogins .Where(el => userExternalLogins .All(uel => el.LoginProvider != uel.LoginProvider)) .ToList(); return(new GetUserExternalLoginsQueryResult() { UserExternalLogins = userExternalLogins, OtherExternalLogins = otherExternalLogins }); }
private BackOfficeIdentityUser AssignLoginsCallback(BackOfficeIdentityUser user) { if (user != null) { var userId = UserIdToInt(user.Id); user.SetLoginsCallback(new Lazy <IEnumerable <IIdentityUserLogin> >(() => _externalLoginService.GetExternalLogins(userId))); user.SetTokensCallback(new Lazy <IEnumerable <IIdentityUserToken> >(() => _externalLoginService.GetExternalLoginTokens(userId))); } return(user); }