[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Artanis] Using #:auth to Authenticate a User

From: Nala Ginrut
Subject: Re: [Artanis] Using #:auth to Authenticate a User
Date: Mon, 17 Sep 2018 01:09:16 +0800
User-agent: mu4e 1.1.0; emacs 25.1.1

Jonathan Schmeling writes:

> Last, – mostly because I'm really interested – how does the
> user-inputted password get passed through the POST call? Does the form
> need to specify the right name? I used passwd mostly as a guess since I
> couldn't find it specified in the doc.s.

The POST is not mysterious, according to HTTP protocol, it's the same
with a common query-string, for example, name=nala&passwd=123
The name of passwd field should be the same you specified in #:auth, for
example, if you write this code in the form:
<input type="password" name="passwd">
Please notice that name of password input was specified to "passwd".

Then you should write authentication like this:
(post "/auth" #:auth '(table user "user" "passwd") #:session #t
(lambda (rc) ...))
Please notice that the "passwd" here is the same with what you specified
in the form.

If you failed to set the correct field name, the authentication will
fail to fetch the correct password but a #f.

Best regards.

GNU Powered it
GPL Protected it
GOD Blessed it
HFG - NalaGinrut
Fingerprint F53B 4C56 95B5 E4D5 6093 4324 8469 6772 846A 0058

Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]