Browse Source

add username check to /sign-up defroute.

Just an extra check in amongst what's already there. If the username
the new sign-up attempt has entered matched one already in the
database, a message is relayed stating as much and redirects back to
the sign-up page.
stable
Craig Oates 2 years ago
parent
commit
19bbba0f3e
  1. 3
      src/web.lisp

3
src/web.lisp

@ -84,6 +84,9 @@
(lack.request:request-body-parameters ningle:*request*))
(cond ((not (string= authenticity-token (auth:csrf-token)))
`(,+forbidden+ (:content-type "text/plain") ("Denied")))
((not (null (nera:get-user username)))
(utils:set-alert "Username already taken.")
(redirect "/sign-up"))
((not (string= password password-check))
(utils:set-alert "Passwords don't match.")
(redirect "/sign-up"))

Loading…
Cancel
Save