*/
@GET
@Path("/logout")
public Response logout() {
BaseModel model = modelBuilder.newBaseModel(httpHeaders);
User user = model.getUser();
if (user != null) {
// Invalidate the session token
user.setSessionToken(null);
// (We'll delete the user but really this would just be an update)
InMemoryUserCache.INSTANCE.hardDelete(user);
model.setUser(null);
}
View view = new PublicFreemarkerView<BaseModel>("openid/logout.ftl", model);
// Remove the session token which will have the effect of logout