use correct length state keys

This commit is contained in:
Anish Mukherjee
2023-01-02 15:42:50 +05:30
parent 93fdf359b3
commit 25e227d551
2 changed files with 2 additions and 4 deletions

View File

@@ -2,7 +2,6 @@ package auth
import (
"encoding/base64"
"encoding/hex"
"encoding/json"
"errors"
"fmt"
@@ -183,7 +182,7 @@ func HandleHeadlessSSO(w http.ResponseWriter, r *http.Request) {
defer conn.Close()
req := &netcache.CValue{User: "", Pass: ""}
stateStr := hex.EncodeToString([]byte(logic.RandomString(headless_signin_length)))
stateStr := logic.RandomString(headless_signin_length)
if err = netcache.Set(stateStr, req); err != nil {
logger.Log(0, "Failed to process sso request -", err.Error())
return