breezewiki/src/page-set-user-settings.rkt

19 lines
597 B
Racket
Raw Normal View History

#lang racket/base
(require racket/dict
net/url
web-server/http
"application-globals.rkt"
"data.rkt"
"../lib/url-utils.rkt"
"../lib/xexpr-utils.rkt")
(provide
page-set-user-settings)
(define (page-set-user-settings req)
(response-handler
2022-12-04 10:44:35 +00:00
(define next-location (dict-ref (url-query (request-uri req)) 'next_location))
(define new-settings (read (open-input-string (dict-ref (url-query (request-uri req)) 'new_settings))))
(define headers (user-cookies-setter new-settings))
2022-12-04 10:44:35 +00:00
(generate-redirect next-location #:headers headers)))