Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 134 additions & 1 deletion docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,65 @@ const docTemplate = `{
}
}
},
"/auth/activate/{id}": {
"get": {
"description": "Activate a user account with the activation token or refresh the token",
"produces": [
"application/json"
],
"tags": [
"users"
],
"summary": "Account Activation",
"parameters": [
{
"type": "string",
"description": "User ID",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Activation token",
"name": "token",
"in": "query"
},
{
"type": "string",
"description": "Refresh activation token (true/false)",
"name": "refresh",
"in": "query"
}
],
"responses": {
"200": {
"description": "User data (Wrapped in data envelope)",
"schema": {
"$ref": "#/definitions/dto.UserResponseDTO"
}
},
"400": {
"description": "Bad request body",
"schema": {
"$ref": "#/definitions/dto.ErrorResponse"
}
},
"401": {
"description": "Invalid token or no param provided or account already active",
"schema": {
"$ref": "#/definitions/dto.ErrorResponse"
}
},
"403": {
"description": "Already logged in",
"schema": {
"$ref": "#/definitions/dto.ErrorResponse"
}
}
}
}
},
"/auth/google": {
"post": {
"description": "Login a user with Google authentication or Create it if it doesn't exist",
Expand Down Expand Up @@ -142,6 +201,61 @@ const docTemplate = `{
}
}
},
"/auth/recovery": {
"post": {
"description": "Request a password recovery code or change the password with the code",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"users"
],
"summary": "Password Recovery",
"parameters": [
{
"type": "string",
"description": "Password recovery token",
"name": "token",
"in": "query"
},
{
"type": "string",
"description": "Refresh password recovery code (true/false)",
"name": "refresh",
"in": "query"
},
{
"description": "Password recovery data",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.PasswordRecoveryDTO"
}
}
],
"responses": {
"204": {
"description": "Password recovery code sent or changed successfully"
},
"400": {
"description": "Bad request body",
"schema": {
"$ref": "#/definitions/dto.ErrorResponse"
}
},
"401": {
"description": "Invalid token or no param provided",
"schema": {
"$ref": "#/definitions/dto.ErrorResponse"
}
}
}
}
},
"/profile": {
"get": {
"description": "Get profile of the current session",
Expand Down Expand Up @@ -193,7 +307,7 @@ const docTemplate = `{
"summary": "Patch profile",
"parameters": [
{
"description": "Profile data (picture is ignored from request - use UploadPicture endpoint)",
"description": "Profile patch data",
"name": "profile",
"in": "body",
"required": true,
Expand Down Expand Up @@ -474,6 +588,20 @@ const docTemplate = `{
}
}
},
"dto.PasswordRecoveryDTO": {
"type": "object",
"required": [
"email"
],
"properties": {
"email": {
"type": "string"
},
"password": {
"type": "string"
}
}
},
"dto.ProfilePatchDTO": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -552,10 +680,15 @@ const docTemplate = `{
"dto.UserResponseDTO": {
"type": "object",
"required": [
"active",
"email",
"id",
"name"
],
"properties": {
"active": {
"type": "boolean"
},
"email": {
"type": "string"
},
Expand Down
135 changes: 134 additions & 1 deletion docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,65 @@
}
}
},
"/auth/activate/{id}": {
"get": {
"description": "Activate a user account with the activation token or refresh the token",
"produces": [
"application/json"
],
"tags": [
"users"
],
"summary": "Account Activation",
"parameters": [
{
"type": "string",
"description": "User ID",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Activation token",
"name": "token",
"in": "query"
},
{
"type": "string",
"description": "Refresh activation token (true/false)",
"name": "refresh",
"in": "query"
}
],
"responses": {
"200": {
"description": "User data (Wrapped in data envelope)",
"schema": {
"$ref": "#/definitions/dto.UserResponseDTO"
}
},
"400": {
"description": "Bad request body",
"schema": {
"$ref": "#/definitions/dto.ErrorResponse"
}
},
"401": {
"description": "Invalid token or no param provided or account already active",
"schema": {
"$ref": "#/definitions/dto.ErrorResponse"
}
},
"403": {
"description": "Already logged in",
"schema": {
"$ref": "#/definitions/dto.ErrorResponse"
}
}
}
}
},
"/auth/google": {
"post": {
"description": "Login a user with Google authentication or Create it if it doesn't exist",
Expand Down Expand Up @@ -135,6 +194,61 @@
}
}
},
"/auth/recovery": {
"post": {
"description": "Request a password recovery code or change the password with the code",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"users"
],
"summary": "Password Recovery",
"parameters": [
{
"type": "string",
"description": "Password recovery token",
"name": "token",
"in": "query"
},
{
"type": "string",
"description": "Refresh password recovery code (true/false)",
"name": "refresh",
"in": "query"
},
{
"description": "Password recovery data",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.PasswordRecoveryDTO"
}
}
],
"responses": {
"204": {
"description": "Password recovery code sent or changed successfully"
},
"400": {
"description": "Bad request body",
"schema": {
"$ref": "#/definitions/dto.ErrorResponse"
}
},
"401": {
"description": "Invalid token or no param provided",
"schema": {
"$ref": "#/definitions/dto.ErrorResponse"
}
}
}
}
},
"/profile": {
"get": {
"description": "Get profile of the current session",
Expand Down Expand Up @@ -186,7 +300,7 @@
"summary": "Patch profile",
"parameters": [
{
"description": "Profile data (picture is ignored from request - use UploadPicture endpoint)",
"description": "Profile patch data",
"name": "profile",
"in": "body",
"required": true,
Expand Down Expand Up @@ -467,6 +581,20 @@
}
}
},
"dto.PasswordRecoveryDTO": {
"type": "object",
"required": [
"email"
],
"properties": {
"email": {
"type": "string"
},
"password": {
"type": "string"
}
}
},
"dto.ProfilePatchDTO": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -545,10 +673,15 @@
"dto.UserResponseDTO": {
"type": "object",
"required": [
"active",
"email",
"id",
"name"
],
"properties": {
"active": {
"type": "boolean"
},
"email": {
"type": "string"
},
Expand Down
Loading