User registration via API
-
Via client:
- [client] POST /api/freighthero/user/register [$user[], $profilevalues[]]
-
model.user.creatingtriggersfreighthero.user.creating.clientwhich will try to register user at host;-
[host] POST /api/freighthero_api/user/register [$user[], $profilevalues[]]
Will create the user on host and triggermodel.user.created.- [prio 0] userprofile stores the values from var $profilevalues[] that are in the request.
- [prio -100] Contactmanager will import the company or attach user to contact. <-fails because App::user() is still null
$tfh_idis created and stored to the profile. User and tfh_id are returned to client, or 400 exception is sent back on fail (e.g. existing username/email).
-
-
When successfully stored at host, client will add the new
$tfh_idto the $profilevalues[] in request, and proceed saving user. -
Event
model.user.createdis triggered on the client after that.- [prio 0] userprofile stores the values from var $profilevalues[] that are in the request.
- [prio -100] Contactmanager skips on client.
-
User is logged on to client
-
Op deze manier wordt een account via client alleen op de master en de afzender client geregistreerd. Dit is niet voldoende.
Altijd eerst op master registreren, en dat broadcasten naar alle clients, dan weer vanaf client of master oppakken.-
[client] POST /api/freighthero/user/register [$user[], $profilevalues[]]
The request will be forwarded to the host-api: -
[host] POST /api/freighthero_api/user/register [$user[], $profilevalues[]]
Will create the user on host and triggermodel.user.created.- [prio 0] userprofile stores the values from var $profilevalues[] that are in the request.
- [prio -100] Contactmanager will import the company or attach user to contact. <-fails because App::user() is still null
$tfh_idis created and stored to the profile. User and tfh_id are returned to client, or 400 exception is sent back on fail (e.g. existing username/email).
- [client] POST /api/freighthero/user/register [$user[], $profilevalues[]]
-
N nikitaskliarov moved this topic from TFH Tech on