mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
chore: Make deployment admin page show better durations (#6856)
* chore: Make deployment admin page show better durations Also fix group mappings
This commit is contained in:
@ -6,7 +6,6 @@ import (
|
||||
"database/sql"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math"
|
||||
"net"
|
||||
"net/http"
|
||||
"strconv"
|
||||
@ -354,19 +353,10 @@ func (api *API) tokenConfig(rw http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
var maxTokenLifetime time.Duration
|
||||
// if --max-token-lifetime is unset (default value is math.MaxInt64)
|
||||
// send back a falsy value
|
||||
if values.MaxTokenLifetime.Value() == time.Duration(math.MaxInt64) {
|
||||
maxTokenLifetime = 0
|
||||
} else {
|
||||
maxTokenLifetime = values.MaxTokenLifetime.Value()
|
||||
}
|
||||
|
||||
httpapi.Write(
|
||||
r.Context(), rw, http.StatusOK,
|
||||
codersdk.TokenConfig{
|
||||
MaxTokenLifetime: maxTokenLifetime,
|
||||
MaxTokenLifetime: values.MaxTokenLifetime.Value(),
|
||||
},
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user