Skip to content
Browse files

Workaround an auth bug

  • Loading branch information...
1 parent d5b2c03 commit da2aebd4d99e1809f9aa46f2e1e31bd00573e83e @tadzik committed
Showing with 3 additions and 4 deletions.
  1. +2 −3 Skunk.cpp
  2. +1 −1 Skunk.hpp
View
5 Skunk.cpp
@@ -73,7 +73,7 @@ int Skunk::Server::addWidget(Skunk::Widget *w) {
* @return zwraca odpowiedz serwera
*
* */
-CSGI::Response Skunk::Server::get(CSGI::Env& env) {
+CSGI::Response Skunk::Server::get(CSGI::Env& env, std::string& username) {
CSGI::Response resp;
int count;
std::stringstream id_str;
@@ -86,7 +86,6 @@ CSGI::Response Skunk::Server::get(CSGI::Env& env) {
resp.content.append("\t<body>");
resp.content.append("\n\t\t<form method='post' action='/'>\n");
- std::string username = isAuthed(env);
for (it = widgets_.begin(); it != widgets_.end(); it++) {
Skunk::Widget *w = *it;
if (auth_->canGET(username, w->id_)) {
@@ -345,7 +344,7 @@ CSGI::Response Skunk::Server::operator()(CSGI::Env& env) {
}
}
- CSGI::Response resp = this->get(env);
+ CSGI::Response resp = this->get(env, username);
if (session.length() > 0)
resp.headers["Set-Cookie"] = "sessionid=" + session
+ "; Max-Age=" + itoa(5*60);
View
2 Skunk.hpp
@@ -225,7 +225,7 @@ class Server : CSGI::Application {
std::string isAuthed(CSGI::Env&);
void removeSession(CSGI::Env&);
void run();
- CSGI::Response get(CSGI::Env&);
+ CSGI::Response get(CSGI::Env&, std::string&);
virtual CSGI::Response operator()(CSGI::Env&);
};

0 comments on commit da2aebd

Please sign in to comment.
Something went wrong with that request. Please try again.