Beispiel #1
0
        public async Task <IActionResult> Register([FromBody] UserDataModel model)
        {
            IUserAccount ua = await m_admin_service.RegisterCustomer(model);

            if (ua == null)
            {
                return(BadRequest());
            }

            IAccessToken accessToken = await m_token_service.GenerateToken(ua);

            if (!string.IsNullOrWhiteSpace(model.Password))
            {
                await m_admin_service.ResetPasspord(accessToken, model.Password, model.ConfirmPassword);
            }

            return(Ok(new AccessTokenModel(accessToken)));
        }