Esempio n. 1
0
  /** This is the entry point method. */
  public void onModuleLoad() {

    final AuthRequest req =
        new AuthRequest(GOOGLE_AUTH_URL, GOOGLE_CLIENT_ID).withScopes(PLUS_ME_SCOPE);

    // Calling login() will display a popup to the user the first
    // time it is
    // called. Once the user has granted access to the application,
    // subsequent calls to login() will not display the popup, and
    // will
    // immediately result in the callback being given the token to
    // use.
    // Auth.get().login(req, new Callback<String, Throwable>() {
    // @Override
    // public void onSuccess(String token) {
    // MaterialToast.alert("Success");
    // }
    //
    // @Override
    // public void onFailure(Throwable caught) {
    // MaterialToast.alert("onFailure");
    // }
    // });
    Defaults.setServiceRoot(GWT.getModuleBaseURL().replace("web", "rest"));

    home();
    //		register();
    //		 emailLogin();
    //		oauth2Login();
  }
  /** This is the entry point method. */
  public void onModuleLoad() {
    Defaults.setServiceRoot(GWT.getModuleBaseURL().replaceFirst("[a-zA-Z0-9_]+/$", ""));
    Defaults.setDispatcher(DefaultDispatcherSingleton.INSTANCE);
    GWT.log("base url for restservices: " + Defaults.getServiceRoot());

    final RideboardGinjector injector = GWT.create(RideboardGinjector.class);

    // setup display
    injector.getApplication().run();

    // Goes to the place represented on URL else default place
    injector.getPlaceHistoryHandler().handleCurrentHistory();
  }