Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Unified Diff: examples/bank_app/bank.cc

Issue 1418013004: Principal Service: Add support for multiple user accounts (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | examples/bank_app/customer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: examples/bank_app/bank.cc
diff --git a/examples/bank_app/bank.cc b/examples/bank_app/bank.cc
index 09ca9540722376a11990a9b3a2d678a7e0a70aab..11a06b56d98cfda13ccf4ba311b1204bc4b1cab5 100644
--- a/examples/bank_app/bank.cc
+++ b/examples/bank_app/bank.cc
@@ -33,14 +33,10 @@ class BankImpl : public Bank {
class BankUser {
public:
explicit BankUser(std::string* user) : user_(user) { }
- void Run(const vanadium::BlessingPtr& b) const {
+ void Run(const vanadium::UserPtr& user) const {
user_->clear();
- if (b && b->chain.size() > 0) {
- user_->append(b->chain[0]->extension);
- for (size_t i = 1; i < b->chain.size(); i++) {
- user_->append(vanadium::ChainSeparator);
- user_->append(b->chain[i]->extension);
- }
+ if (user) {
+ *user_ = user->email;
}
}
private:
@@ -64,7 +60,7 @@ class BankApp : public mojo::ApplicationDelegate,
vanadium::AppInstanceNamePtr app(vanadium::AppInstanceName::New());
app->url = url;
std::string user;
- login_service_->GetUserBlessing(app.Pass(), BankUser(&user));
+ login_service_->GetUser(app.Pass(), BankUser(&user));
// Check and see whether we got a valid user blessing.
if (!login_service_.WaitForIncomingResponse()) {
MOJO_LOG(INFO) << "Failed to get a valid user blessing";
« no previous file with comments | « no previous file | examples/bank_app/customer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698