/** * Retrieves the username from the HTTP request; the default is to read from the session cookie. * * @param req the current request * @return the username if the user is authenticated. */ public Optional<String> getUsername(Request req) { return req.session().getOptional("username"); }
/** * Retrieves the username from the HTTP request; the default is to read from the session cookie. * * @param req the current request * @return the username if the user is authenticated. */ public Optional<String> getUsername(Request req) { return req.session().getOptional("username"); }
/** * Optionally returns the session value associated with a key. */ public Optional<String> apply(String key) { return getOptional(key); }
/** * Retrieves the username from the HTTP request; the default is to read from the session cookie. * * @param req the current request * @return the username if the user is authenticated. */ public Optional<String> getUsername(Request req) { return req.session().getOptional("username"); }
/** * Optionally returns the session value associated with a key. */ public Optional<String> apply(String key) { return getOptional(key); }
/** * Optionally returns the session value associated with a key. */ public Optional<String> apply(String key) { return getOptional(key); }