Nicklas Laine Overgaard - 261 - Jun 4, 2014

What is the default behavior of the RegistrationFeature when you are logged in and then call the /register route with some data?

I’m asking because of an administration system I am building, where I want to be able to create new users via the /register route (when logged in as an administrator) - however, it seems as if calling this route in the attempt to create a new user simply updates the currently logged in user.

Is this the case, and is there a way to work around this? Or have I done something horribly wrong in my code.

Thanks!

Wayne Douglas:

I would have thought it would add a new userauthdetails record and link it to the same userauth - could be wrong though

Yeah it affects the currently logged in user. I would create your own admin services that use the UserAuthRepository like the Registration Service does, i.e: https://github.com/ServiceStack/ServiceStack/blob/master/src/ServiceStack/Auth/RegisterService.cs#L99-L100

Nicklas Laine Overgaard:

+Demis Bellot Thanks for the clarification, will do :slight_smile:

Nick Karnik:

Glad that it wasn’t just me going crazy over this. Developers were losing their accounts and we were completely perplexed until i looked hard at the db and noticed that the number of accounts was the same which led me to down investigating the update path.

A register call should not update. The update call is present for that purpose. It should either be configurable or another explicit end-point should be introduced that can create/update.