Friday, April 22, 2016

Re: What needs to be done after a successful login

I think it is worth deciding what you want to happen when the users credentials timeout (or are lost) on the server side.

Personally I hate it when Ajax/single page apps quietly fail when authentication has expired.

Cheers

Sam

On Monday, April 11, 2016 at 3:10:53 PM UTC+1, Olar Andrei wrote:
Hello,

I'm new to GWT and a I have a problem, which I don't understand quite well. I'm making a GWT application where a user is required to log in. So I do my stuff, by checking the username and password if they match and so on.
But, on the onSuccess() method, what needs to be done in order to open the actual application ? I mean the current application is just the login screen with the DB connection. What needs to be done if they match, how do I open a new page, or a new application... ?

I understood that GWT basically is just a one-page application. Then how should I do this ? 

Thanks in advance.

DBConnectionAsync rpcService = (DBConnectionAsync) GWT.create(DBConnection.class);
ServiceDefTarget target = (ServiceDefTarget) rpcService;
String moduleRelativeURL = GWT.getModuleBaseURL() + "DBConnectionImpl";
target.setServiceEntryPoint(moduleRelativeURL);
rpcService.authenticateUser("admin", "admin", new AsyncCallback<User>() {
   @Override
   public void onSuccess(User result) {
     // What to do here ?
   }
   @Override
   public void onFailure(Throwable caught) {
      // Failure
   }
});


--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment