diff --git a/coderd/apidoc/docs.go b/coderd/apidoc/docs.go index 26df5b8fee..e72a68fd6c 100644 --- a/coderd/apidoc/docs.go +++ b/coderd/apidoc/docs.go @@ -2865,11 +2865,6 @@ const docTemplate = `{ }, "/users/login": { "post": { - "security": [ - { - "CoderSessionToken": [] - } - ], "consumes": [ "application/json" ], diff --git a/coderd/apidoc/swagger.json b/coderd/apidoc/swagger.json index 66a8369ff5..1237855b4c 100644 --- a/coderd/apidoc/swagger.json +++ b/coderd/apidoc/swagger.json @@ -2517,11 +2517,6 @@ }, "/users/login": { "post": { - "security": [ - { - "CoderSessionToken": [] - } - ], "consumes": ["application/json"], "produces": ["application/json"], "tags": ["Authorization"], diff --git a/coderd/coderdtest/swaggerparser.go b/coderd/coderdtest/swaggerparser.go index 8ff5b78871..0670648ca3 100644 --- a/coderd/coderdtest/swaggerparser.go +++ b/coderd/coderdtest/swaggerparser.go @@ -297,7 +297,8 @@ func assertPathParametersDefined(t *testing.T, comment SwaggerComment) { func assertSecurityDefined(t *testing.T, comment SwaggerComment) { if comment.router == "/updatecheck" || comment.router == "/buildinfo" || - comment.router == "/" { + comment.router == "/" || + comment.router == "/users/login" { return // endpoints do not require authorization } assert.Equal(t, "CoderSessionToken", comment.security, "@Security must be equal CoderSessionToken") diff --git a/coderd/users.go b/coderd/users.go index 9ad4d208f3..6c237f421c 100644 --- a/coderd/users.go +++ b/coderd/users.go @@ -988,7 +988,6 @@ func (api *API) organizationByUserAndName(rw http.ResponseWriter, r *http.Reques // // @Summary Log in user // @ID log-in-user -// @Security CoderSessionToken // @Accept json // @Produce json // @Tags Authorization diff --git a/docs/api/authorization.md b/docs/api/authorization.md index 24375e8cd6..a4cdec1659 100644 --- a/docs/api/authorization.md +++ b/docs/api/authorization.md @@ -74,8 +74,7 @@ To perform this operation, you must be authenticated. [Learn more](authenticatio # Example request using curl curl -X POST http://coder-server:8080/api/v2/users/login \ -H 'Content-Type: application/json' \ - -H 'Accept: application/json' \ - -H 'Coder-Session-Token: API_KEY' + -H 'Accept: application/json' ``` `POST /users/login` @@ -110,5 +109,3 @@ curl -X POST http://coder-server:8080/api/v2/users/login \ | Status | Meaning | Description | Schema | | ------ | ------------------------------------------------------------ | ----------- | ---------------------------------------------------------------------------------- | | 201 | [Created](https://tools.ietf.org/html/rfc7231#section-6.3.2) | Created | [codersdk.LoginWithPasswordResponse](schemas.md#codersdkloginwithpasswordresponse) | - -To perform this operation, you must be authenticated. [Learn more](authentication.md).