diff --git a/API/OCM.Net/OCM.API.Core/Common/UserManager.cs b/API/OCM.Net/OCM.API.Core/Common/UserManager.cs index bfb29425..af5ab062 100644 --- a/API/OCM.Net/OCM.API.Core/Common/UserManager.cs +++ b/API/OCM.Net/OCM.API.Core/Common/UserManager.cs @@ -169,7 +169,7 @@ public User RegisterNewUser(API.Common.Model.RegistrationModel model) SetNewPassword(userDetails.Id, (PasswordChangeModel)model); AssignNewSessionToken(userDetails.Id); - return API.Common.Model.Extensions.User.BasicFromDataModel(userDetails); + return GetUser(userDetails.Id); } public User GetUser(int id) diff --git a/API/OCM.Net/OCM.API.Core/OCM.API.Core.csproj b/API/OCM.Net/OCM.API.Core/OCM.API.Core.csproj index dd46c2db..3d32c5d4 100644 --- a/API/OCM.Net/OCM.API.Core/OCM.API.Core.csproj +++ b/API/OCM.Net/OCM.API.Core/OCM.API.Core.csproj @@ -57,7 +57,7 @@ - + diff --git a/API/OCM.Net/OCM.API.Web/Compatibility/CompatibilityAPIHandler.cs b/API/OCM.Net/OCM.API.Web/Compatibility/CompatibilityAPIHandler.cs index 8247e5d4..186f72f1 100644 --- a/API/OCM.Net/OCM.API.Web/Compatibility/CompatibilityAPIHandler.cs +++ b/API/OCM.Net/OCM.API.Web/Compatibility/CompatibilityAPIHandler.cs @@ -746,7 +746,7 @@ private async Task OutputProfileRegisterResult(IOutputProvider outputProvider, H string access_token = null; var responseEnvelope = new APIResponseEnvelope(); - if (user != null) + if (user == null) { context.Response.StatusCode = 401; return; @@ -845,6 +845,13 @@ private void SetAPIDefaults(HttpContext context) this.IsQueryByPost = true; } + if (context.Request.Path.ToString().Contains("profile/register")) + { + this.APIBehaviourVersion = 3; + this.DefaultAction = "profile.register"; + this.IsQueryByPost = true; + } + if (context.Request.Path.ToString().Contains("comment")) { this.APIBehaviourVersion = 3; diff --git a/API/OCM.Net/OCM.API.Web/Controllers/ProfileController.cs b/API/OCM.Net/OCM.API.Web/Controllers/ProfileController.cs index 8045db86..461d5c4a 100644 --- a/API/OCM.Net/OCM.API.Web/Controllers/ProfileController.cs +++ b/API/OCM.Net/OCM.API.Web/Controllers/ProfileController.cs @@ -42,8 +42,7 @@ public ActionResult Authenticate(LoginModel login) } [HttpPost] - - public ActionResult Register([FromBody]LoginModel registration) + public ActionResult Register([FromBody] RegistrationModel registration) { if (string.IsNullOrWhiteSpace(registration.EmailAddress)) { @@ -58,7 +57,7 @@ public ActionResult Register([FromBody]LoginModel registration) if (!userManager.IsExistingUser(registration.EmailAddress)) { // credentials don't match existing user - var user = userManager.RegisterNewUser(new RegistrationModel { EmailAddress=registration.EmailAddress, Password=registration.Password, Username = registration.Username}); + var user = userManager.RegisterNewUser(registration); if (user == null) { diff --git a/Import/OCM.Import.Common/OCM.Import.Common.csproj b/Import/OCM.Import.Common/OCM.Import.Common.csproj index 035e6359..887c3e45 100644 --- a/Import/OCM.Import.Common/OCM.Import.Common.csproj +++ b/Import/OCM.Import.Common/OCM.Import.Common.csproj @@ -42,7 +42,7 @@ - + diff --git a/Tests/OCM.API.Tests/OCM.API.Tests.csproj b/Tests/OCM.API.Tests/OCM.API.Tests.csproj index 4afaaca7..a916498e 100644 --- a/Tests/OCM.API.Tests/OCM.API.Tests.csproj +++ b/Tests/OCM.API.Tests/OCM.API.Tests.csproj @@ -57,8 +57,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Website/OCM.Web/OCM.Web.csproj b/Website/OCM.Web/OCM.Web.csproj index b02f2bb4..a43e022a 100644 --- a/Website/OCM.Web/OCM.Web.csproj +++ b/Website/OCM.Web/OCM.Web.csproj @@ -22,7 +22,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive