Skip to content

Commit 20fc87c

Browse files
committed
fixed auth
1 parent ef09103 commit 20fc87c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

coderd/userauth.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ func (api *API) postLogin(rw http.ResponseWriter, r *http.Request) {
132132
UserID: user.ID,
133133
LoginType: database.LoginTypePassword,
134134
RemoteAddr: r.RemoteAddr,
135+
TokenName: namesgenerator.GetRandomName(1),
135136
})
136137
if err != nil {
137138
httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{
@@ -920,6 +921,7 @@ func (api *API) oauthLogin(r *http.Request, params oauthLoginParams) (*http.Cook
920921
UserID: user.ID,
921922
LoginType: params.LoginType,
922923
RemoteAddr: r.RemoteAddr,
924+
TokenName: namesgenerator.GetRandomName(1),
923925
})
924926
if err != nil {
925927
return nil, database.APIKey{}, xerrors.Errorf("create API key: %w", err)

0 commit comments

Comments
 (0)