From 47243870e2784c6a7d3e8237c7cac9e46815cff3 Mon Sep 17 00:00:00 2001 From: Jon Lambson Date: Mon, 21 Aug 2017 11:21:00 -0600 Subject: [PATCH 1/5] fixing signout --- index.html | 4 +- js/controllers/login-controller.js | 6 + js/controllers/website-controller.js | 2 +- js/services/auth-service.js | 4 +- js/www@daplie.com.js | 2 +- templates/account-settings.html | 2 +- templates/contacts.html | 247 ++++++++++++++++++++++++++- templates/partials/header.html | 2 +- 8 files changed, 252 insertions(+), 17 deletions(-) diff --git a/index.html b/index.html index c06650f..55404dd 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,5 @@ - + Launch-pad @@ -9,7 +9,7 @@ - +
diff --git a/js/controllers/login-controller.js b/js/controllers/login-controller.js index 56f294e..6e32e47 100644 --- a/js/controllers/login-controller.js +++ b/js/controllers/login-controller.js @@ -4,6 +4,7 @@ app.controller('loginCtrl', [ var vm = this; + vm.currentPath = $location.url().substr(1); vm.independentIssuer = false; vm.oauth3 = Oauth3.oauth3 = Oauth3.oauth3 || Oauth3.create(location); vm.timers = {}; @@ -122,6 +123,10 @@ app.controller('loginCtrl', [ vm.newIssuer = vm.defaultIssuer; vm.setIssuer(vm.defaultIssuer); + vm.initGetSession = function() { + return Auth.select(Auth.session); + } + vm.initListLoggedInProfiles = function () { vm.activeProfiles = Auth.getActiveSessions(); }; @@ -136,6 +141,7 @@ app.controller('loginCtrl', [ }; vm.signOut = function () { + // TODO the sign-out url for each account should be fixed. return Auth.signOut().then(function () { if (Auth.sessions.length === 0) { diff --git a/js/controllers/website-controller.js b/js/controllers/website-controller.js index 3911950..eeea18a 100644 --- a/js/controllers/website-controller.js +++ b/js/controllers/website-controller.js @@ -32,7 +32,7 @@ app.controller('websiteCtrl', [ return $q.all(Auth.sessions.map(function (session) { return Auth.select(session).then(function (oauth3) { - + console.log('asdf'); return oauth3.api(apiname, {}).then(function (collection) { if (collection.error) { diff --git a/js/services/auth-service.js b/js/services/auth-service.js index 4c4b4c4..6979c6a 100644 --- a/js/services/auth-service.js +++ b/js/services/auth-service.js @@ -64,12 +64,11 @@ app.factory('Auth', [ Auth.sessions.push(session); }); - return Auth.session; } , select: function (session) { if (!session.issuer) { - throw new Error("session doesn't have an issuer");; + throw new Error("session doesn't have an issuer"); } var name = session.token.sub + '@' + session.token.iss; @@ -105,7 +104,6 @@ app.factory('Auth', [ , signOut: function () { var session = Auth.session; var dapName = 'dap-' + session.subject + '|' + session.issuer; - // TODO logout url should be created upon login and remain fixed throughout the duration of the session (or on session restoration) return Auth.oauth3.logout().then(function () { var obj = JSON.parse(localStorage.getItem(dapSessions) || '{}'); diff --git a/js/www@daplie.com.js b/js/www@daplie.com.js index 061c87c..59f87e6 100644 --- a/js/www@daplie.com.js +++ b/js/www@daplie.com.js @@ -7,7 +7,7 @@ OAUTH3._pkgs['www@daplie.com'] = { add: function (opts) { var providerUri = opts.audience; var session = opts.session; - + debugger; return OAUTH3.request({ method: 'POST' , url: OAUTH3.url.normalize(providerUri) diff --git a/templates/account-settings.html b/templates/account-settings.html index d6fe426..1e0510c 100644 --- a/templates/account-settings.html +++ b/templates/account-settings.html @@ -60,7 +60,7 @@ Use Account
- Sign Out + Sign Out
diff --git a/templates/contacts.html b/templates/contacts.html index 26dc776..3b49e47 100644 --- a/templates/contacts.html +++ b/templates/contacts.html @@ -1,12 +1,243 @@ -

Contacts

+
- + -
+

You haven't added any contacts yet!

+
+
+ +
+ + +
+

Importing Contacts...

+ +
+
+ 30% Complete +
+
+ +

Recent Contacts

+ + + + + + + + + + + + + + + + + + + + +
Best Friendbest@frind.com555-555-5309
Notbest Friendnot@best.com555-867-5555
Uncle Benuncle@ben.com555-867-1234
+ +

Core to reconnect with these old friends?

+ +
+ + + + + + + + + + + + + + + + + + + +
John Doejohn@doe.com555-867-5309 + + +
Bob Smithbob@smith.com555-867-5308 + + +
Jane Austinjane@austin.com555-867-5307 + + +
+
+ +
+ + +
+
+ + John Doe +
+

john@doe.com

+

555-867-5309

+ +
+
+ +
+
+ +
+
+
+
+

Conversations

+
+ + | + +
+

Photos

+
+ + | + +
+

Files

+
+ + | + +

More

+
+
+ +
+

Me: Hey John, did you know that you are my best friend?

+

John: No way! You're my best friend, too!

+

Me: Wow! We sure are awesome friends together! :)

+
+
+
+
+
+
+
+
+
+
+ +
+
+ +

filename.ext

+
+
+ +

filename.ext

+
+
+ +

filename.ext

+
+
+ +

filename.ext

+
+
+ +

filename.ext

+
+
+
+ +
+
+

Remember when...?

+
+
+
+
Taken Feb 20, 2017
+
+ +
+
+
+
Sent on June 5, 2017
+
+

Hey Jane,

+

Love the new do!

+

You're so lucky to have great
hair I'm super jealous...

+
+
+
+
Shared on Ap...
+
+ +
+

Come Fly with Me

+

Frank Sinatra

+
+
+
+
+
+ +
+ + diff --git a/templates/partials/header.html b/templates/partials/header.html index fb4afac..4033d13 100644 --- a/templates/partials/header.html +++ b/templates/partials/header.html @@ -1,4 +1,4 @@ -