Commit f68550b14a0ad1a74acada80e15dfc9c46c2703b
1 parent
dd6cbe78
Fixed authorisation check
Showing
2 changed files
with
4 additions
and
0 deletions
cpp11/Ice/auth/Client.cpp
@@ -66,6 +66,8 @@ int run(const shared_ptr<Ice::Communicator>& communicator) | @@ -66,6 +66,8 @@ int run(const shared_ptr<Ice::Communicator>& communicator) | ||
66 | ctx["token"] = token; | 66 | ctx["token"] = token; |
67 | auto proxy2 = proxy->ice_context(ctx); | 67 | auto proxy2 = proxy->ice_context(ctx); |
68 | proxy2->function(); | 68 | proxy2->function(); |
69 | + proxy->function(ctx); | ||
70 | + proxy->function(); | ||
69 | 71 | ||
70 | return 0; | 72 | return 0; |
71 | } | 73 | } |
cpp11/Ice/auth/ContextI.cpp
@@ -18,6 +18,8 @@ ContextI::function(const Ice::Current& c) | @@ -18,6 +18,8 @@ ContextI::function(const Ice::Current& c) | ||
18 | { | 18 | { |
19 | // check token | 19 | // check token |
20 | const auto p = c.ctx.find("token"); | 20 | const auto p = c.ctx.find("token"); |
21 | + if (p == c.ctx.end()) | ||
22 | + return; | ||
21 | if (p != c.ctx.end() && p->second != "secretToken") | 23 | if (p != c.ctx.end() && p->second != "secretToken") |
22 | return; | 24 | return; |
23 | cout << "function" << endl; | 25 | cout << "function" << endl; |