artanis
[Top][All Lists]
Advanced

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

Re: Does #:with-auth support redirection?


From: Nala Ginrut
Subject: Re: Does #:with-auth support redirection?
Date: Fri, 13 Aug 2021 02:09:09 +0800
User-agent: mu4e 1.4.15; emacs 27.2

Basically, this issue is not requesting the URI support in
redirect-to. Although this issue can be naively fixed by adding URI support
to #:with-auth.

The redirect-to doesn't simply add host.addr to the URI, it will detect
host.name first, if it exists then use it, if not, use host.addr.
So if you have set host.name, it should use it.

Unfortunately, there's a bug in (current-myhost) to return wrong result
that ingored the correct real host.
This was fixed just now:
https://gitlab.com/NalaGinrut/artanis/-/commit/0e927fe0b38bd7be549b2257b486fa626f7aa856

BTW, you don't have to use (get-conf '(host name)), the standard way should be 
(current-myhost).
I've exported this proc in the same commit.

Best regards.


Mortimer Cladwell writes:

> Hi,
> I am running artanis on an AWS EC2 instance (NO Docker) with the following
> entries in artanis.conf:
>
> host.name = 3.13.182.53
> host.addr = 0.0.0.0
>
> My login page is at http://3.13.182.53:3000/login   (Note: fake IP to
> protect the innocent)
>
> I have a method for redirection that supplies a URI:
>
> (define (get-redirect-uri dest)
>    (string->uri (string-append "http://"; (get-conf '(host name)) ":3000/"
> (string-trim dest #\/))))
>
>  An example of successful use of redirection:
>
>    (redirect-to rc (get-redirect-uri (string-append "plateset/getps?id="
>  prjid)))
>
>  In general the redirection works fine except for #:with-auth, which
> requires a string (not URI) and #:with-auth simply appends to "host.addr"
> which is not correct for EC2 (and Docker I predict)
>
>    #:with-auth #t redirects to http://0.0.0.0:3000/login
>
>   Are there other options/strategies for redirection with #:with-auth?
>   Thanks
>   Mortimer


--
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]