Skip to content

Commit

Permalink
web,user: document why keys are set using a hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogdanp committed Nov 12, 2024
1 parent deb7146 commit bf742bf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions congame-web/components/user.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@

#:pre-persist-hook
(lambda (u)
;; We don't use a default here because we want to use the username
;; in the key generation itself to make collisions less likely.
(define user-with-key
(cond
[(and (user-api-key u) (not (sql-null? (user-api-key u)))) u]
Expand Down

0 comments on commit bf742bf

Please sign in to comment.