Confirm
/api/v2/user/confirm/${username}/${password}
Get
users
profiles
groups
rooms
Purpose
To allow a registered user to confirm his / her email address.
URL Parameters [input]
{
username: string,
token: string
}
Returns if valid [output]
{
message: string,
error: 0
}
What the API does
- Fetches the
username
andtoken
from the URL as parameters. - Checks if there is a record in the
users
collection with theusername
supplied [404]. - Checks if the
token
supplied is valid and corresponds to the one saved in the fetched record [401]. - Finds the
konnect
group and creates a new record for that user in in itsmembers
field if that’s not already the case and adds a newgroup_invite
with a state ofaccepted
in theprofile
of the user. - Finds the
konnect
room and creates a new record for that user in in itsmembers
field if that’s not already the case and adds a newchat_invite
with a state ofaccepted
in theprofile
of the user. - Sets the
active
field of theusers
collection concerned totrue
and itsprev_email
value to that of itsemail
.