Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Logout(Logout redirect)
Logout [message #1747247] Fri, 11 November 2016 09:08 Go to next message
Luka Cavic is currently offline Luka CavicFriend
Messages: 26
Registered: August 2014
Junior Member
Hi,

I am using custom form for login to application. execGuiAttached is showing form. Now when I click logout, that destorys session I am redirected to /logout. Then I need to remove /logout from url and to login again.

Question is: How to disable that redirect, and display form for login again, call execGuiAttached again? Thanks
Re: Logout [message #1747377 is a reply to message #1747247] Mon, 14 November 2016 07:47 Go to previous messageGo to next message
Andre Wegmueller is currently offline Andre WegmuellerFriend
Messages: 33
Registered: September 2012
Location: Baden-D├Ąttwil, Switzerla...
Member
When you do a logout, the UI server sends a logout event to the browser. This event contains the logout URL, which is "./logout" by default. This URL is defined in the UiSession class. You can simply change this URL to "login", so the login-form will be shown when a user clicks on logout in the UI. To do this you must subclass UiSession and override the getLogoutRedirectUrl method, like this:

  
  @Override
  public String getLogoutRedirectUrl() {
    return "login";
  }


Use the BeanManager to register your custom UiSession (see: https://eclipsescout.github.io/6.0/technical-guide.html#sec-bean.manager)
Re: Logout [message #1794132 is a reply to message #1747247] Fri, 24 August 2018 08:26 Go to previous messageGo to next message
Corrado Parisi is currently offline Corrado ParisiFriend
Messages: 32
Registered: September 2016
Member
I am facing the same issue. As suggested I created a class overriding UiSession and returning "login" in getLogoutRedirectUrl(). The class is registered automatically in the Bean Manager since the Interface IUiSession has the @Bean annotation.

When starting the app I get an Initialization error: org.eclipse.scout.rt.platform.util.Assertions$AssertionException: Assertion error: multiple instances found for query: interface org.eclipse.scout.rt.ui.html.IUiSession

This makes sense, since there are now two instances, the class UiSession and mine.

Is there a new approach for that?
Re: Logout [message #1794138 is a reply to message #1794132] Fri, 24 August 2018 09:15 Go to previous messageGo to next message
Stephan Merkli is currently offline Stephan MerkliFriend
Messages: 21
Registered: April 2012
Junior Member
You may have forgotten to add the @Replace annotation to your new class, that's probably why two instances are found.
Re: Logout [message #1795086 is a reply to message #1794138] Fri, 14 September 2018 08:56 Go to previous message
Corrado Parisi is currently offline Corrado ParisiFriend
Messages: 32
Registered: September 2016
Member
That was exactly the problem, thank you for the hint.
Previous Topic:User credential and verification
Next Topic:EclipseCon Europe - Userconf
Goto Forum:
  


Current Time: Sun Sep 23 09:55:57 GMT 2018

Powered by FUDForum. Page generated in 0.01465 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top