From 1a5e864b015b0339bf0ab3724fe65c0f9dd83aa3 Mon Sep 17 00:00:00 2001 From: SauceyRed Date: Mon, 28 Apr 2025 23:44:14 +0200 Subject: [PATCH] Add explanation for refresh_token to login/register tables --- API/client-server/v1/login.md | 15 ++++++++------- API/client-server/v1/register.md | 17 +++++++++-------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/API/client-server/v1/login.md b/API/client-server/v1/login.md index b35f73b..9758fe5 100644 --- a/API/client-server/v1/login.md +++ b/API/client-server/v1/login.md @@ -9,7 +9,7 @@ Authenticates the user, and issues an access token for future requests. ## Request | Name | Type | Description | -|-------------|--------|----------------------------------------------------------------------------------------------------------------| +| ----------- | ------ | -------------------------------------------------------------------------------------------------------------- | | identifier | string | User's gorb ID. One of identifier and email **must** be implemented | | email | string | User's email. One of identifier and email **must** be implemented | | password | string | **Required**: The user's password (we need to figure out how exactly we're hashing + salting it on the client) | @@ -28,7 +28,7 @@ Authenticates the user, and issues an access token for future requests. ## Responses | Status | Description | -|--------|------------------------------------------------| +| ------ | ---------------------------------------------- | | 200 | Authentication successful | | 400 | The post request included poorly formated data | | 403 | Part of the cridentials are invalid. | @@ -37,11 +37,12 @@ Authenticates the user, and issues an access token for future requests. ### 200 -| Name | Type | Description | -|--------------|--------|-----------------------------------------------------------------------------| -| access_token | string | **Required**: The access token that will be used for further authentication | -| user_id | string | **Required**: The full gorb ID for the account | -| expires_in | int | How many seconds until the token expires and is invalidated | +| Name | Type | Description | +| ------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------- | +| access_token | string | **Required**: The access token that will be used for further authentication | +| user_id | string | **Required**: The full gorb ID for the account | +| expires_in | int | How many seconds until the token expires and is invalidated | +| refresh_token | string | The refresh token that will be used to refresh the access token. Required for avoiding users having to log in after access token expiration. | ```json { diff --git a/API/client-server/v1/register.md b/API/client-server/v1/register.md index 4ddbe18..43cfe85 100644 --- a/API/client-server/v1/register.md +++ b/API/client-server/v1/register.md @@ -9,7 +9,7 @@ Registers the user, and issues an access token for future requests. ## Request | Name | Type | Description | -|-------------|--------|----------------------------------------------------------------------------------------------------------------| +| ----------- | ------ | -------------------------------------------------------------------------------------------------------------- | | identifier | string | **Required** User's desired ID | | email | string | **Required** User's email | | password | string | **Required**: The user's password (we need to figure out how exactly we're hashing + salting it on the client) | @@ -29,7 +29,7 @@ Registers the user, and issues an access token for future requests. ## Responses | Status | Description | -|--------|-------------------------------------------------------------------------------------------------------------------------------| +| ------ | ----------------------------------------------------------------------------------------------------------------------------- | | 200 | Registration successful | | 400 | The post request included poorly formated data | | 403 | Signups are disabled, gorb ID not available, email already in use, or password doesn't meet the minimum security requirements | @@ -38,11 +38,12 @@ Registers the user, and issues an access token for future requests. ### 200 -| Name | Type | Description | -|--------------|--------|-----------------------------------------------------------------------------| -| access_token | string | **Required**: The access token that will be used for further authentication | -| user_id | string | **Required**: The full gorb ID for the account | -| expires_in | int | How many seconds until the token expires and is invalidated | +| Name | Type | Description | +| ------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------- | +| access_token | string | **Required**: The access token that will be used for further authentication | +| user_id | string | **Required**: The full gorb ID for the account | +| expires_in | int | How many seconds until the token expires and is invalidated | +| refresh_token | string | The refresh token that will be used to refresh the access token. Required for avoiding users having to log in after access token expiration. | ```json { @@ -58,7 +59,7 @@ Registers the user, and issues an access token for future requests. ### 403 | Name | Type | Description | -|-----------------------------|------|--------------------------------------------------------------------------------| +| --------------------------- | ---- | ------------------------------------------------------------------------------ | | signups_enabled | bool | Does the server have signups enabled? | | gorb_id_valid | bool | Is the given gorb ID even valid? | | gorb_id_available | bool | Is the given gorb ID available? |