Build the 'login' view-- this page lets the user either create a new account or login with an existing account via "otp login url by email" request. #14
{
status: 0,
errCode: "User.002" or "User.003"
errMsg: "User.002: Non-unique email address." or "User.003: Invalid field."
title: "Mayor",
name: "Dave the Mighty",
sovereignty: "Dave Nation",
email: "dave@example.com"
}
Notes/Questions:
REST HTTP Headers? Always 200? Or 404 on invalid user? Need to still investigate.
Always also return submitted user object back in payload?
Login User (Send OTP Email) Spec:
URI: /v1/otp_token
Method: POST
Receive:
{
email: "user@example.com"
}
If User found, return:
{
status: 1,
email: "user@example.com"
}
If User not found, return:
{
status: 0,
email: "user@example.com"
}
Notes/Questions:
REST HTTP Headers? Always 200? Or 404 on invalid user? Need to still investigate.
Always also return submitted email back in payload?
Create User Spec:
URI: /v1/user Method: POST
Receive:
If User creation successful, return:
If User creation failed, return:
Notes/Questions: REST HTTP Headers? Always 200? Or 404 on invalid user? Need to still investigate. Always also return submitted user object back in payload?
Login User (Send OTP Email) Spec:
URI: /v1/otp_token Method: POST
Receive:
If User found, return:
If User not found, return:
Notes/Questions: REST HTTP Headers? Always 200? Or 404 on invalid user? Need to still investigate. Always also return submitted email back in payload?