mirror of
https://github.com/ilyakooo0/urbit.git
synced 2025-01-06 23:16:29 +03:00
eyre: don't lose redirect upon failing login
If we failed the password check, the login page served to us would never include any redirect details, even if they were there in the original request. Now we simply (attempt to) parse out the redirect field a little earlier.
This commit is contained in:
parent
80ead610ea
commit
a4785458d1
@ -950,12 +950,13 @@
|
|||||||
?~ parsed
|
?~ parsed
|
||||||
(return-static-data-on-duct 400 'text/html' (login-page ~ our))
|
(return-static-data-on-duct 400 'text/html' (login-page ~ our))
|
||||||
::
|
::
|
||||||
|
=/ redirect=(unit @t) (get-header:http 'redirect' u.parsed)
|
||||||
?~ password=(get-header:http 'password' u.parsed)
|
?~ password=(get-header:http 'password' u.parsed)
|
||||||
(return-static-data-on-duct 400 'text/html' (login-page ~ our))
|
(return-static-data-on-duct 400 'text/html' (login-page redirect our))
|
||||||
:: check that the password is correct
|
:: check that the password is correct
|
||||||
::
|
::
|
||||||
?. =(u.password code)
|
?. =(u.password code)
|
||||||
(return-static-data-on-duct 400 'text/html' (login-page ~ our))
|
(return-static-data-on-duct 400 'text/html' (login-page redirect our))
|
||||||
:: mint a unique session cookie
|
:: mint a unique session cookie
|
||||||
::
|
::
|
||||||
=/ session=@uv
|
=/ session=@uv
|
||||||
@ -981,7 +982,7 @@
|
|||||||
=- out(moves [- moves.out])
|
=- out(moves [- moves.out])
|
||||||
[duct %pass /sessions/expire %b %wait expires-at]
|
[duct %pass /sessions/expire %b %wait expires-at]
|
||||||
::
|
::
|
||||||
?~ redirect=(get-header:http 'redirect' u.parsed)
|
?~ redirect
|
||||||
%- handle-response
|
%- handle-response
|
||||||
:* %start
|
:* %start
|
||||||
:- status-code=200
|
:- status-code=200
|
||||||
|
Loading…
Reference in New Issue
Block a user