You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Henry Loenwind <wi...@loenwind.info> on 2017/11/14 17:32:29 UTC

restartResponseAtSignInPage()/continueToOriginalDestination() and dedicated LOGIN button

Hi,

I ran into a small issue when using restartResponseAtSignInPage() and 
continueToOriginalDestination() from a dedicated login button (i.e. a 
button that should keep the user on their current page, not link them 
into a restricted area).

It basically works fine, but continueToOriginalDestination() sends them 
back into the onClick() of the login button...which no longer 
isVisible() because the user now is logged in. Naturally that doesn't 
work but gives a "friendly" error message.

Now, "login in place" buttons are not that outlandish, so I wanted to 
ask how other people solve this problem. My first try was to manually 
wipe the page parameters from the InterceptData, but all that is 
accessible there is set(), get() and clear(). My next tries would then 
be to (a) re-implement my own InterceptData, which I do not really want 
to do---duplicating framework functionality by copy&pasting is ugly; or 
(b) subclass the Link to still be isVisible() but render as "" when the 
user is logged in.

cu
Henry

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: restartResponseAtSignInPage()/continueToOriginalDestination() and dedicated LOGIN button

Posted by Sven Meier <sv...@meiers.net>.
Keep it simple: just set the SignInPage as response page and give it an 
(optional) page reference to return to after login.

Have fun
Sven


Am 14.11.2017 um 18:32 schrieb Henry Loenwind:
> Hi,
>
> I ran into a small issue when using restartResponseAtSignInPage() and 
> continueToOriginalDestination() from a dedicated login button (i.e. a 
> button that should keep the user on their current page, not link them 
> into a restricted area).
>
> It basically works fine, but continueToOriginalDestination() sends 
> them back into the onClick() of the login button...which no longer 
> isVisible() because the user now is logged in. Naturally that doesn't 
> work but gives a "friendly" error message.
>
> Now, "login in place" buttons are not that outlandish, so I wanted to 
> ask how other people solve this problem. My first try was to manually 
> wipe the page parameters from the InterceptData, but all that is 
> accessible there is set(), get() and clear(). My next tries would then 
> be to (a) re-implement my own InterceptData, which I do not really 
> want to do---duplicating framework functionality by copy&pasting is 
> ugly; or (b) subclass the Link to still be isVisible() but render as 
> "" when the user is logged in.
>
> cu
> Henry
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org