Skip to content

Commit 896158c

Browse files
authored
fix: remove authentication requirement for /users/login (coder#5717)
This was noticed by a member of our Discord being incorrectly documented! https://discord.com/channels/747933592273027093/1063494965130432632/1063503805016182875
1 parent f5db4bc commit 896158c

File tree

5 files changed

+3
-16
lines changed

5 files changed

+3
-16
lines changed

coderd/apidoc/docs.go

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/coderdtest/swaggerparser.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,8 @@ func assertPathParametersDefined(t *testing.T, comment SwaggerComment) {
297297
func assertSecurityDefined(t *testing.T, comment SwaggerComment) {
298298
if comment.router == "/updatecheck" ||
299299
comment.router == "/buildinfo" ||
300-
comment.router == "/" {
300+
comment.router == "/" ||
301+
comment.router == "/users/login" {
301302
return // endpoints do not require authorization
302303
}
303304
assert.Equal(t, "CoderSessionToken", comment.security, "@Security must be equal CoderSessionToken")

coderd/users.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,6 @@ func (api *API) organizationByUserAndName(rw http.ResponseWriter, r *http.Reques
988988
//
989989
// @Summary Log in user
990990
// @ID log-in-user
991-
// @Security CoderSessionToken
992991
// @Accept json
993992
// @Produce json
994993
// @Tags Authorization

docs/api/authorization.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ To perform this operation, you must be authenticated. [Learn more](authenticatio
7474
# Example request using curl
7575
curl -X POST http://coder-server:8080/api/v2/users/login \
7676
-H 'Content-Type: application/json' \
77-
-H 'Accept: application/json' \
78-
-H 'Coder-Session-Token: API_KEY'
77+
-H 'Accept: application/json'
7978
```
8079

8180
`POST /users/login`
@@ -110,5 +109,3 @@ curl -X POST http://coder-server:8080/api/v2/users/login \
110109
| Status | Meaning | Description | Schema |
111110
| ------ | ------------------------------------------------------------ | ----------- | ---------------------------------------------------------------------------------- |
112111
| 201 | [Created](https://tools.ietf.org/html/rfc7231#section-6.3.2) | Created | [codersdk.LoginWithPasswordResponse](schemas.md#codersdkloginwithpasswordresponse) |
113-
114-
To perform this operation, you must be authenticated. [Learn more](authentication.md).

0 commit comments

Comments
 (0)