コード例 #1
0
ファイル: BaseAsyncDAO.java プロジェクト: osarrat/sigmah
  /**
   * Retrieves the current authentication.
   *
   * @return The current authentication.
   */
  public Authentication getAuthentication() {
    final Authentication authentication = authenticationProvider.get();

    if (authentication.getUserEmail() == null) {
      // Search the last logged user in the users database
      final Storage storage = Storage.getLocalStorageIfSupported();
      final String email = storage.getItem(LocalDispatchServiceAsync.LAST_USER_ITEM);

      authentication.setUserEmail(email);
    }

    return authentication;
  }