From 6553291c66dc999f27934694e4e0f36d6513b807 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 22 Jan 2019 21:26:58 +0000 Subject: IceSpider 0.5 string_view updates --- gentoobrowse/src/base.cpp | 2 +- gentoobrowse/src/user.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gentoobrowse/src/base.cpp b/gentoobrowse/src/base.cpp index 5ed5114..e9c3033 100644 --- a/gentoobrowse/src/base.cpp +++ b/gentoobrowse/src/base.cpp @@ -12,7 +12,7 @@ namespace GentooBrowse { common::currentUser(const IceSpider::IHttpRequest * request) const { if (auto sid = request->getCookieParam("sessionId")) { - if (auto s = prx0->getSession(*sid)) { + if (auto s = prx0->getSession(std::string(*sid))) { auto uid = s->variables.find("userId"); if (uid != s->variables.end()) { return prx1->get(boost::lexical_cast(uid->second)); diff --git a/gentoobrowse/src/user.cpp b/gentoobrowse/src/user.cpp index cf56b43..c764872 100644 --- a/gentoobrowse/src/user.cpp +++ b/gentoobrowse/src/user.cpp @@ -35,7 +35,7 @@ namespace GentooBrowse { auto s = prx0->createSession(); s->variables[USERID] = boost::lexical_cast(user->userid); prx0->updateSession(s); - request->setCookie(SESSIONID, s->id, IceUtil::None, "/"s); + request->setCookie(SESSIONID, s->id, std::nullopt, "/"s); request->responseRedirect("/user/home", "Authenticated"s); } @@ -113,7 +113,7 @@ namespace GentooBrowse { auto s = prx0->createSession(); s->variables[USERID] = boost::lexical_cast(user->userid); prx0->updateSession(s); - request->setCookie(SESSIONID, s->id, IceUtil::None, "/"s); + request->setCookie(SESSIONID, s->id, std::nullopt, "/"s); request->responseRedirect("/user/home", "Verified, welcome!"s); } @@ -246,7 +246,7 @@ namespace GentooBrowse { void execute(IceSpider::IHttpRequest * request) const { prx0->destroySession(*request->getCookieParam(SESSIONID)); - request->setCookie(SESSIONID, std::string(), IceUtil::None, "/"s, false, 0); + request->setCookie(SESSIONID, std::string(), std::nullopt, "/"s, false, 0); request->responseRedirect("/", "Logged out"s); } -- cgit v1.2.3