Skip to content
Snippets Groups Projects
Commit dbfc08af authored by srosse's avatar srosse
Browse files

OO-5309: prevent double redirect to the login provider

parent a86e288c
No related branches found
No related tags found
No related merge requests found
...@@ -31,6 +31,7 @@ import org.olat.core.gui.components.form.flexible.impl.FormBasicController; ...@@ -31,6 +31,7 @@ import org.olat.core.gui.components.form.flexible.impl.FormBasicController;
import org.olat.core.gui.components.form.flexible.impl.FormEvent; import org.olat.core.gui.components.form.flexible.impl.FormEvent;
import org.olat.core.gui.components.link.Link; import org.olat.core.gui.components.link.Link;
import org.olat.core.gui.control.Controller; import org.olat.core.gui.control.Controller;
import org.olat.core.gui.control.DispatchResult;
import org.olat.core.gui.control.WindowControl; import org.olat.core.gui.control.WindowControl;
import org.olat.core.gui.control.generic.dtabs.Activateable2; import org.olat.core.gui.control.generic.dtabs.Activateable2;
import org.olat.core.gui.media.MediaResource; import org.olat.core.gui.media.MediaResource;
...@@ -115,8 +116,11 @@ public class OAuthAuthenticationController extends FormBasicController implement ...@@ -115,8 +116,11 @@ public class OAuthAuthenticationController extends FormBasicController implement
} }
private void redirect(UserRequest ureq, OAuthSPI provider) { private void redirect(UserRequest ureq, OAuthSPI provider) {
HttpSession session = ureq.getHttpReq().getSession(); DispatchResult result = ureq.getDispatchResult();
MediaResource redirectResource = new OAuthResource(provider, session); if(result.getResultingMediaResource() == null) {// prevent twice the redirect
ureq.getDispatchResult().setResultingMediaResource(redirectResource); HttpSession session = ureq.getHttpReq().getSession();
MediaResource redirectResource = new OAuthResource(provider, session);
result.setResultingMediaResource(redirectResource);
}
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment