Exemplo n.º 1
0
        public async Task <InvokeResult> AcceptInvitationAsync(string inviteid)
        {
            var result = await _orgManager.AcceptInvitationAsync(inviteid, OrgEntityHeader, UserEntityHeader);

            /* Make sure we update the claims */
            var currentUser = await GetCurrentUserAsync();

            await _signInManager.SignInAsync(currentUser);

            return(result);
        }
        public async Task <InvokeResult <AuthResponse> > CreateNewAsync([FromBody] RegisterUser newUser)
        {
            var result = await _appUserManager.CreateUserAsync(newUser);

            if (!String.IsNullOrEmpty(newUser.InviteId) && result.Successful)
            {
                await _orgManager.AcceptInvitationAsync(newUser.InviteId, result.Result.User.Id);

                var user = await _appUserManager.GetUserByIdAsync(result.Result.User.Id, OrgEntityHeader, result.Result.User);

                await _signInManager.SignInAsync(user, false);
            }

            return(result);
        }