mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-18 08:16:39 +00:00
fix linter
This commit is contained in:
@@ -133,6 +133,11 @@ func (h *PATHandler) CreateToken(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
pat, err := server.CreateNewPAT(req.Name, req.ExpiresIn, user.Id)
|
||||
if err != nil {
|
||||
util.WriteError(err, w)
|
||||
return
|
||||
}
|
||||
|
||||
err = h.accountManager.AddPATToUser(account.Id, userID, &pat.PersonalAccessToken)
|
||||
if err != nil {
|
||||
util.WriteError(err, w)
|
||||
|
||||
@@ -3,7 +3,6 @@ package http
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
@@ -148,7 +147,7 @@ func TestTokenHandlers(t *testing.T) {
|
||||
requestType: http.MethodPost,
|
||||
requestPath: "/api/users/" + existingUserID + "/tokens",
|
||||
requestBody: bytes.NewBuffer(
|
||||
[]byte(fmt.Sprint("{\"name\":\"name\",\"expires_in\":7}"))),
|
||||
[]byte("{\"name\":\"name\",\"expires_in\":7}")),
|
||||
expectedStatus: http.StatusOK,
|
||||
expectedBody: true,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user