Fix rest of var name in main code

This commit is contained in:
Kristoffer Dalby 2021-11-15 16:15:50 +00:00
parent 471c0b4993
commit 333be80f9c
No known key found for this signature in database
GPG key ID: 09F62DC067465735
6 changed files with 137 additions and 130 deletions

View file

@ -76,15 +76,15 @@ func (h *Headscale) RegisterOIDC(ctx *gin.Context) {
return
}
b := make([]byte, RANDOM_BYTE_SIZE)
if _, err := rand.Read(b); err != nil {
randomBlob := make([]byte, RANDOM_BYTE_SIZE)
if _, err := rand.Read(randomBlob); err != nil {
log.Error().Msg("could not read 16 bytes from rand")
ctx.String(http.StatusInternalServerError, "could not read 16 bytes from rand")
return
}
stateStr := hex.EncodeToString(b)[:32]
stateStr := hex.EncodeToString(randomBlob)[:32]
// place the machine key into the state cache, so it can be retrieved later
h.oidcStateCache.Set(stateStr, mKeyStr, OIDC_STATE_CACHE_EXPIRATION)