Merge pull request #6929 from urbit/pkova/eauth-localhost

eyre: do not store localhost as eauth-url
This commit is contained in:
Pyry Kovanen 2024-03-21 17:24:13 +02:00 committed by GitHub
commit 2c27b7a83d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1306,7 +1306,13 @@
o(session-id session.fex) o(session-id session.fex)
:: store the hostname used for this login, later reuse it for eauth :: store the hostname used for this login, later reuse it for eauth
:: ::
=? endpoint.auth.state ?=(^ host) =? endpoint.auth.state
:: avoid overwriting public domains with localhost
::
?& ?=(^ host)
?| ?=(~ auth.endpoint.auth.state)
!=('localhost' (fall (rush u.host host-sans-port) ''))
== ==
%- (trace 2 |.("eauth: storing endpoint at {(trip u.host)}")) %- (trace 2 |.("eauth: storing endpoint at {(trip u.host)}"))
=/ new-auth=(unit @t) =/ new-auth=(unit @t)
`(cat 3 ?:(secure 'https://' 'http://') u.host) `(cat 3 ?:(secure 'https://' 'http://') u.host)