You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by Chris Papagrigoriou <ch...@googlemail.com> on 2012/07/22 03:14:47 UTC

Redirect User after deleting his account.

Hey there,

im trying to give the user the posibility to delete his own profile. 
After deleting his profile I want to redirect him to the login.html

When I delete the user in my Servlet though, his session is destroyed 
and response.sendRedirect("login.html"); doesnt work. Instead I get 
redirected to the sling login page saying "Invalid Credentials".

Does anyone know a good way to do this?



Re: Redirect User after deleting his account.

Posted by Eric Norman <er...@gmail.com>.
Hi Chris,

I believe you should be able to just redirect to the logout servlet and
pass it the resource you want to go to after the logout is processed.  The
logout servlet will clear out the old auth info and the redirect to your
target resource.

For example, something like this:

response.sendRedirect("/system/sling/logout?resource=/system/sling/login");

Regards,
Eric

On Sat, Jul 21, 2012 at 6:14 PM, Chris Papagrigoriou <
chris.grigorious@googlemail.com> wrote:

> Hey there,
>
> im trying to give the user the posibility to delete his own profile. After
> deleting his profile I want to redirect him to the login.html
>
> When I delete the user in my Servlet though, his session is destroyed and
> response.sendRedirect("login.**html"); doesnt work. Instead I get
> redirected to the sling login page saying "Invalid Credentials".
>
> Does anyone know a good way to do this?
>
>
>