Skip to content

Commit

Permalink
refactor: use correct claim attrib in JWT
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyoptimist committed Jun 16, 2024
1 parent cb106d7 commit 7c2813a
Show file tree
Hide file tree
Showing 5 changed files with 116 additions and 108 deletions.
71 changes: 37 additions & 34 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@ const docTemplate = `{
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/utils.HttpError"
"$ref": "#/definitions/common.HttpError"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/utils.HttpError"
"$ref": "#/definitions/common.HttpError"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/utils.HttpError"
"$ref": "#/definitions/common.HttpError"
}
}
}
Expand All @@ -78,13 +78,13 @@ const docTemplate = `{
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/utils.HttpError"
"$ref": "#/definitions/common.HttpError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/utils.HttpError"
"$ref": "#/definitions/common.HttpError"
}
}
}
Expand Down Expand Up @@ -117,13 +117,13 @@ const docTemplate = `{
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/utils.HttpError"
"$ref": "#/definitions/common.HttpError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/utils.HttpError"
"$ref": "#/definitions/common.HttpError"
}
}
}
Expand Down Expand Up @@ -156,13 +156,13 @@ const docTemplate = `{
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/utils.HttpError"
"$ref": "#/definitions/common.HttpError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/utils.HttpError"
"$ref": "#/definitions/common.HttpError"
}
}
}
Expand Down Expand Up @@ -192,7 +192,7 @@ const docTemplate = `{
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/utils.HttpError"
"$ref": "#/definitions/common.HttpError"
}
}
}
Expand Down Expand Up @@ -228,13 +228,13 @@ const docTemplate = `{
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/utils.HttpError"
"$ref": "#/definitions/common.HttpError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/utils.HttpError"
"$ref": "#/definitions/common.HttpError"
}
}
}
Expand All @@ -261,13 +261,13 @@ const docTemplate = `{
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/utils.HttpError"
"$ref": "#/definitions/common.HttpError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/utils.HttpError"
"$ref": "#/definitions/common.HttpError"
}
}
}
Expand Down Expand Up @@ -303,19 +303,19 @@ const docTemplate = `{
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/utils.HttpError"
"$ref": "#/definitions/common.HttpError"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/utils.HttpError"
"$ref": "#/definitions/common.HttpError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/utils.HttpError"
"$ref": "#/definitions/common.HttpError"
}
}
}
Expand Down Expand Up @@ -346,7 +346,7 @@ const docTemplate = `{
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/utils.HttpError"
"$ref": "#/definitions/common.HttpError"
}
}
}
Expand Down Expand Up @@ -389,19 +389,19 @@ const docTemplate = `{
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/utils.HttpError"
"$ref": "#/definitions/common.HttpError"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/utils.HttpError"
"$ref": "#/definitions/common.HttpError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/utils.HttpError"
"$ref": "#/definitions/common.HttpError"
}
}
}
Expand Down Expand Up @@ -430,6 +430,9 @@ const docTemplate = `{
"accessToken": {
"type": "string"
},
"expiresIn": {
"type": "number"
},
"refreshToken": {
"type": "string"
}
Expand Down Expand Up @@ -471,6 +474,19 @@ const docTemplate = `{
}
}
},
"common.HttpError": {
"type": "object",
"properties": {
"message": {
"type": "string",
"example": "bad request"
},
"statusCode": {
"type": "integer",
"example": 400
}
}
},
"model.User": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -530,19 +546,6 @@ const docTemplate = `{
"type": "string"
}
}
},
"utils.HttpError": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"example": 400
},
"message": {
"type": "string",
"example": "bad request"
}
}
}
},
"securityDefinitions": {
Expand Down
Loading

0 comments on commit 7c2813a

Please sign in to comment.