[+] Add login API

This commit is contained in:
Hykilpikonna
2021-01-22 15:42:39 -05:00
parent 021368d7bb
commit 2ced920106
+23 -12
View File
@@ -43,21 +43,32 @@ class APIs
Register the user in the database. Register the user in the database.
## Parameters ## Parameters
- name: The user's name (this is not username because it doesn't have to be unique) - username: The user's unique username
- email: The user's email (this does have to be unique) - password: Password hash
- pass: Password (initial hash)
## Returns ## Returns
Success or error Success or error
*/ */
static let register = API<String>(loc: "/user/register") static let register = API<String>(loc: "/user/register")
/**
Verify password and login.
## Parameters
- username: The user's unique username
- password: Password hash
## Returns
Success or error
*/
static let login = API<String>(loc: "/user/login")
/** /**
Delete a user from the database. Delete a user from the database.
## Parameters ## Parameters
- email: The user's email - username: The user's unique username
- pass: Password (initial hash) - password: Password hash
## Returns ## Returns
Success or error Success or error
@@ -67,7 +78,7 @@ class APIs
/** /**
Upload curent config to the cloud. Upload curent config to the cloud.
## Parameters ## Parameters (Besides from username and password)
- config: The config json - config: The config json
## Returns ## Returns
@@ -78,7 +89,7 @@ class APIs
/** /**
Download the config from the cloud. Download the config from the cloud.
## Parameters ## Parameters (Besides from username and password)
None None
## Returns ## Returns
@@ -89,7 +100,7 @@ class APIs
/** /**
Create a family Create a family
## Parameters ## Parameters (Besides from username and password)
- fname: Family name - fname: Family name
- pin: Admin pin - pin: Admin pin
@@ -101,7 +112,7 @@ class APIs
/** /**
Delete a family Delete a family
## Parameters ## Parameters (Besides from username and password)
- fid: Family ID - fid: Family ID
- pin: Admin pin - pin: Admin pin
@@ -113,7 +124,7 @@ class APIs
/** /**
Change a family's admin pin Change a family's admin pin
## Parameters ## Parameters (Besides from username and password)
- fid: Family ID - fid: Family ID
- orig_pin: Original admin pin - orig_pin: Original admin pin
- new_pin: New admin pin - new_pin: New admin pin
@@ -126,7 +137,7 @@ class APIs
/** /**
Join family Join family
## Parameters ## Parameters (Besides from username and password)
- fid: Family ID - fid: Family ID
- pin: Admin pin - pin: Admin pin
@@ -138,7 +149,7 @@ class APIs
/** /**
Leave family Leave family
## Parameters ## Parameters (Besides from username and password)
- fid: Family ID - fid: Family ID
- pin: Admin pin - pin: Admin pin