(authenticate {:keys [query-fn secret] :as authenticator}
id
password
&
{:keys [expiry] :or {expiry 24}})
Authenticates the user identified by id
and password
and returns a hash map
with :id
and :token
(JWT token) in addition to any other data returned by
the query-fn if the authentication is successful. A nil is returned if the authentication
fails.
Authenticates the user identified by `id` and `password` and returns a hash map with `:id` and `:token` (JWT token) in addition to any other data returned by the query-fn if the authentication is successful. A nil is returned if the authentication fails.
(hash-password password)
Hashes password
using the default algorithm (currently :bcrypt+sha512)
Hashes `password` using the default algorithm (currently :bcrypt+sha512)
(validate-token {:keys [secret] :as authenticator} token)
Validates the token
using authenticator
Validates the `token` using `authenticator`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close