├── examples ├── angularjs │ ├── public │ │ ├── css │ │ │ ├── .gitkeep │ │ │ └── app.css │ │ ├── img │ │ │ └── .gitkeep │ │ ├── partials │ │ │ ├── .gitkeep │ │ │ ├── partial1.html │ │ │ ├── login.html │ │ │ └── signup.html │ │ ├── js │ │ │ ├── services.js │ │ │ ├── directives.js │ │ │ ├── filters.js │ │ │ ├── controllers.js │ │ │ └── app.js │ │ ├── index.html │ │ └── lib │ │ │ └── angular │ │ │ ├── angular-route.min.js │ │ │ └── angular.min.js │ ├── package.json │ ├── README.md │ └── app.js ├── http-basic-auth │ ├── public │ │ ├── css │ │ │ ├── .gitkeep │ │ │ └── app.css │ │ ├── img │ │ │ └── .gitkeep │ │ ├── partials │ │ │ ├── .gitkeep │ │ │ ├── partial1.html │ │ │ ├── login.html │ │ │ └── signup.html │ │ ├── js │ │ │ ├── directives.js │ │ │ ├── filters.js │ │ │ ├── controllers.js │ │ │ ├── app.js │ │ │ └── services.js │ │ ├── index.html │ │ └── lib │ │ │ └── angular │ │ │ └── angular-route.min.js │ ├── package.json │ ├── README.md │ └── app.js ├── login │ ├── views │ │ ├── index.ejs │ │ ├── account.ejs │ │ ├── login.ejs │ │ └── layout.ejs │ ├── package.json │ ├── README.md │ └── app.js ├── signup-login │ ├── views │ │ ├── index.ejs │ │ ├── account.ejs │ │ ├── login.ejs │ │ ├── layout.ejs │ │ └── signup.ejs │ ├── package.json │ ├── README.md │ └── app.js └── stateless-login │ ├── views │ ├── index.ejs │ ├── account.ejs │ ├── login.ejs │ └── layout.ejs │ ├── package.json │ ├── README.md │ └── app.js ├── lib └── passport-userapp │ ├── index.js │ └── strategy.js ├── package.json ├── LICENSE └── README.md /examples/angularjs/public/css/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/angularjs/public/img/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/angularjs/public/partials/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/http-basic-auth/public/css/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/http-basic-auth/public/img/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/http-basic-auth/public/partials/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/login/views/index.ejs: -------------------------------------------------------------------------------- 1 | <% layout('layout') -%> 2 | <% if (!user) { %> 3 |
Here's all the articles from the back-end API using our session token:
2 | 3 |Here's all the articles from the back-end API using our session token:
2 | 3 |Username: <%= user.username %>
3 |Email: <%= user.email %>
4 | 5 | <% if(user.groups) { %> 6 |Groups:
8 |Username: <%= user.username %>
3 |Email: <%= user.email %>
4 | 5 | <% if(user.groups) { %> 6 |Groups:
8 |Username: <%= user.username %>
3 |Email: <%= user.email %>
4 | 5 | <% if(user.groups) { %> 6 |Groups:
8 |Please log in
2 | 3 | 9 | 10 | -------------------------------------------------------------------------------- /examples/signup-login/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "passport-userapp-examples-login", 3 | "version": "0.0.0", 4 | "dependencies": { 5 | "express": "3.x.x", 6 | "connect-flash": "0.1.x", 7 | "ejs": ">= 0.0.0", 8 | "ejs-locals": ">= 0.0.0", 9 | "passport": ">= 0.0.0", 10 | "passport-userapp": "userapp-io/passport-userapp", 11 | "underscore": "1.4.3", 12 | "userapp": "~0.2.3" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /examples/http-basic-auth/public/partials/login.html: -------------------------------------------------------------------------------- 1 |Please log in
2 | 3 | 9 | 10 | -------------------------------------------------------------------------------- /examples/login/views/login.ejs: -------------------------------------------------------------------------------- 1 | <% layout('layout') -%> 2 | <% if (message) { %> 3 |<%= message %>
4 | <% } %> 5 | 18 | -------------------------------------------------------------------------------- /examples/signup-login/views/login.ejs: -------------------------------------------------------------------------------- 1 | <% layout('layout') -%> 2 | <% if (message) { %> 3 |<%= message %>
4 | <% } %> 5 | 18 | -------------------------------------------------------------------------------- /examples/stateless-login/views/login.ejs: -------------------------------------------------------------------------------- 1 | <% layout('layout') -%> 2 | <% if (message) { %> 3 |<%= message %>
4 | <% } %> 5 | 18 | -------------------------------------------------------------------------------- /examples/login/views/layout.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |14 | Home | 15 | Account | 16 | Log Out 17 |
18 | <% } %> 19 | <%- body %> 20 | 21 | 22 | -------------------------------------------------------------------------------- /examples/stateless-login/views/layout.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |14 | Home | 15 | Account | 16 | Log Out 17 |
18 | <% } %> 19 | <%- body %> 20 | 21 | 22 | -------------------------------------------------------------------------------- /examples/angularjs/public/partials/signup.html: -------------------------------------------------------------------------------- 1 |Sign up
2 | 3 | 10 | 11 | -------------------------------------------------------------------------------- /examples/http-basic-auth/public/partials/signup.html: -------------------------------------------------------------------------------- 1 |Sign up
2 | 3 | 10 | 11 | -------------------------------------------------------------------------------- /examples/signup-login/views/layout.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |9 | Home | 10 | Log In | 11 | Sign Up 12 |
13 | <% } else { %> 14 |15 | Home | 16 | Account | 17 | Log Out 18 |
19 | <% } %> 20 | <%- body %> 21 | 22 | 23 | -------------------------------------------------------------------------------- /examples/angularjs/public/css/app.css: -------------------------------------------------------------------------------- 1 | /* app css stylesheet */ 2 | 3 | .menu { 4 | list-style: none; 5 | border-bottom: 0.1em solid black; 6 | margin-bottom: 2em; 7 | padding: 0 0 0.5em; 8 | } 9 | 10 | .menu:before { 11 | content: "["; 12 | } 13 | 14 | .menu:after { 15 | content: "]"; 16 | } 17 | 18 | .menu > li { 19 | display: inline; 20 | } 21 | 22 | .menu > li:before { 23 | content: "|"; 24 | padding-right: 0.3em; 25 | } 26 | 27 | .menu > li:nth-child(1):before { 28 | content: ""; 29 | padding: 0; 30 | } 31 | -------------------------------------------------------------------------------- /examples/http-basic-auth/public/css/app.css: -------------------------------------------------------------------------------- 1 | /* app css stylesheet */ 2 | 3 | .menu { 4 | list-style: none; 5 | border-bottom: 0.1em solid black; 6 | margin-bottom: 2em; 7 | padding: 0 0 0.5em; 8 | } 9 | 10 | .menu:before { 11 | content: "["; 12 | } 13 | 14 | .menu:after { 15 | content: "]"; 16 | } 17 | 18 | .menu > li { 19 | display: inline; 20 | } 21 | 22 | .menu > li:before { 23 | content: "|"; 24 | padding-right: 0.3em; 25 | } 26 | 27 | .menu > li:nth-child(1):before { 28 | content: ""; 29 | padding: 0; 30 | } 31 | -------------------------------------------------------------------------------- /examples/angularjs/public/js/controllers.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /* Controllers */ 4 | 5 | angular.module('myApp.controllers', []) 6 | .controller('MyCtrl1', function($scope, $http) { 7 | // Call the back-end API which will be authenticated using our session 8 | $http({method: 'GET', url: '/articles'}). 9 | success(function(data, status, headers, config) { 10 | //The API call to the back-end was successful (i.e. a valid session) 11 | $scope.articles = data; 12 | }). 13 | error(function(data, status, headers, config) { 14 | alert("The API call to the back-end was NOT successful (i.e. an invalid session)."); 15 | }); 16 | }); -------------------------------------------------------------------------------- /examples/signup-login/views/signup.ejs: -------------------------------------------------------------------------------- 1 | <% layout('layout') -%> 2 | <% if (message) { %> 3 |<%= message %>
4 | <% } %> 5 |