Junie: cleanups. Code fixups.
This commit is contained in:
@@ -159,7 +159,7 @@ func (s *Server) sendError(w http.ResponseWriter, message string, status int) {
|
||||
|
||||
// Create a generic error message based on status code
|
||||
publicMessage := "An error occurred processing your request"
|
||||
errorCode := "E" + string(status)
|
||||
errorCode := fmt.Sprintf("E%000d", status)
|
||||
|
||||
// Customize public messages for common status codes
|
||||
// but don't leak specific details about the error
|
||||
@@ -254,7 +254,7 @@ func (s *Server) createToken(userID string) (string, int64, error) {
|
||||
return "", 0, err
|
||||
}
|
||||
|
||||
// Hex encode the random bytes to get a 32-character string
|
||||
// Hex encode the random bytes to get a 32-character string.
|
||||
token := hex.EncodeToString(tokenBytes)
|
||||
|
||||
expires := time.Now().Add(24 * time.Hour).Unix()
|
||||
|
||||
Reference in New Issue
Block a user