Add something like the following line to your login view. It stores the requested page during the login.
Then get the requested uri in your login bean.
FacesContext context = FacesContext.getCurrentInstance();
String redirect = context.getExternalContext().getRequestParameterMap().get("redirect");
Add ?faces-redirect=true to the string and return it.