diff --git a/css/styles.css b/css/styles.css index 17b1755..7dd4293 100644 --- a/css/styles.css +++ b/css/styles.css @@ -15,7 +15,6 @@ .login-container { top: 25vh; } - /* Common CSS */ .cp { cursor: pointer; diff --git a/js/app.js b/js/app.js index e06eb10..64662f0 100644 --- a/js/app.js +++ b/js/app.js @@ -11,17 +11,15 @@ app.config(['$stateProvider', '$urlRouterProvider', 'localStorageServiceProvider data: { requiresLogin: false }, url: '/splash-page', templateUrl: '/templates/splash-page.html', - controller: 'loginCtrl', - controllerAs: 'vm' + controller: 'loginCtrl as vm' }) .state('app',{ data: { requiresLogin: true }, url: '/', + controller: 'loginCtrl as vm', views: { 'header': { templateUrl: '/templates/partials/header.html', - controller: 'loginCtrl', - controllerAs: 'vm' }, 'menu': { templateUrl: '/templates/partials/menu.html' @@ -36,8 +34,7 @@ app.config(['$stateProvider', '$urlRouterProvider', 'localStorageServiceProvider views: { 'content@': { templateUrl: 'templates/home.html', - controller: 'loginCtrl', - controllerAs: 'vm' + controller: 'loginCtrl as vm' } } }) @@ -46,8 +43,7 @@ app.config(['$stateProvider', '$urlRouterProvider', 'localStorageServiceProvider views: { 'content@': { templateUrl: 'templates/bolt.html', - controller: 'boltCtrl', - controllerAs: 'vm' + controller: 'boltCtrl as vm', } } }) @@ -56,8 +52,7 @@ app.config(['$stateProvider', '$urlRouterProvider', 'localStorageServiceProvider views: { 'content@': { templateUrl: 'templates/files.html', - controller: 'fileCtrl', - controllerAs: 'vm' + controller: 'fileCtrl as vm', } } }) @@ -66,8 +61,7 @@ app.config(['$stateProvider', '$urlRouterProvider', 'localStorageServiceProvider views: { 'content@': { templateUrl: 'templates/contacts.html', - controller: 'contactCtrl', - controllerAs: 'vm' + controller: 'contactCtrl as vm', } } }) @@ -76,8 +70,7 @@ app.config(['$stateProvider', '$urlRouterProvider', 'localStorageServiceProvider views: { 'content@': { templateUrl: 'templates/music.html', - controller: 'musicCtrl', - controllerAs: 'vm' + controller: 'musicCtrl as vm', } } }) @@ -86,8 +79,7 @@ app.config(['$stateProvider', '$urlRouterProvider', 'localStorageServiceProvider views: { 'content@': { templateUrl: 'templates/email.html', - controller: 'emailCtrl', - controllerAs: 'vm' + controller: 'emailCtrl as vm', } } }) @@ -96,8 +88,7 @@ app.config(['$stateProvider', '$urlRouterProvider', 'localStorageServiceProvider views: { 'content@': { templateUrl: 'templates/website.html', - controller: 'websiteCtrl', - controllerAs: 'vm' + controller: 'websiteCtrl as vm', } } }) @@ -107,7 +98,6 @@ app.config(['$stateProvider', '$urlRouterProvider', 'localStorageServiceProvider 'content@': { templateUrl: 'templates/dns.html', controller: 'dnsCtrl', - controllerAs: 'vm' } } }) @@ -116,8 +106,7 @@ app.config(['$stateProvider', '$urlRouterProvider', 'localStorageServiceProvider views: { 'content@': { templateUrl: 'templates/account-settings.html', - controller: 'loginCtrl', - controllerAs: 'vm' + controller: 'loginCtrl as vm', } } }); diff --git a/js/controllers/bolt-controller.js b/js/controllers/bolt-controller.js index fa8f59c..4e5b423 100644 --- a/js/controllers/bolt-controller.js +++ b/js/controllers/bolt-controller.js @@ -1,10 +1,6 @@ app.controller('boltCtrl', [ '$scope', 'Auth', function($scope, Auth) { - + var vm = this; - vm.userName = function(profile){ - profile = Auth.getProfile(); - return profile.email; - }; }]); diff --git a/js/controllers/contact-controller.js b/js/controllers/contact-controller.js index 8e56cc1..2235e3c 100644 --- a/js/controllers/contact-controller.js +++ b/js/controllers/contact-controller.js @@ -1,4 +1,4 @@ -app.controller('contactCrtl', [ +app.controller('contactCtrl', [ '$scope', function($scope) { diff --git a/js/controllers/login-controller.js b/js/controllers/login-controller.js index 56f294e..bcca67c 100644 --- a/js/controllers/login-controller.js +++ b/js/controllers/login-controller.js @@ -122,6 +122,10 @@ app.controller('loginCtrl', [ vm.newIssuer = vm.defaultIssuer; vm.setIssuer(vm.defaultIssuer); + vm.getSession = function() { + return Auth.select(Auth.session); + }; + vm.initListLoggedInProfiles = function () { vm.activeProfiles = Auth.getActiveSessions(); }; @@ -136,13 +140,15 @@ 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) { - $location.path('/splash-page'); - return; - } - window.alert("You are still logged in with other accounts."); + vm.getSession().then(function(){ + // TODO the sign-out url for each account should be fixed. + return Auth.signOut().then(function () { + if (Auth.sessions.length === 0) { + $location.path('/splash-page'); + return; + } + window.alert("You are still logged in with other accounts."); + }); }); }; diff --git a/js/services/auth-service.js b/js/services/auth-service.js index d719b10..0bc7791 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; @@ -108,7 +107,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 c90fed0..472226b 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..75e88b9 100644 --- a/templates/account-settings.html +++ b/templates/account-settings.html @@ -1,7 +1,5 @@ -
+ | Best Friend | +best@frind.com | +555-555-5309 | +
+ | Notbest Friend | +not@best.com | +555-867-5555 | +
+ | Uncle Ben | +uncle@ben.com | +555-867-1234 | +
John Doe | +john@doe.com | +555-867-5309 | ++ + + | +
Bob Smith | +bob@smith.com | +555-867-5308 | ++ + + | +
Jane Austin | +jane@austin.com | +555-867-5307 | ++ + + | +
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
+Hey Jane,
+Love the new do!
+You're so lucky to have great
hair I'm super jealous...
Come Fly with Me
+Frank Sinatra
+