-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: migrate loopback-example-passport repo as lb4 example
- Loading branch information
1 parent
848272d
commit ce3626f
Showing
55 changed files
with
4,339 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules/ | ||
dist/ | ||
coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
extends: '@loopback/eslint-config', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# Typescript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
# Transpiled JavaScript files from Typescript | ||
/dist | ||
|
||
# Cache used by TypeScript's incremental build | ||
*.tsbuildinfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Exclude *.tsbuildinfo - cache for tsc incremental builds | ||
*.tsbuildinfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package-lock=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist | ||
*.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"bracketSpacing": false, | ||
"singleQuote": true, | ||
"printWidth": 80, | ||
"trailingComma": "all" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"ids": { | ||
"User": 2, | ||
"UserIdentity": 100487451443373280000 | ||
}, | ||
"models": { | ||
"User": { | ||
"1": "{\"name\":\"Open Graph Test User\",\"username\":\"[email protected]\",\"email\":\"[email protected]\",\"id\":1}" | ||
}, | ||
"UserIdentity": { | ||
"104566694532668": "{\"id\":\"104566694532668\",\"provider\":\"facebook\",\"profile\":{\"emails\":[{\"value\":\"[email protected]\"}]},\"authScheme\":\"facebook\",\"created\":\"2020-04-07T18:40:25.360Z\",\"userId\":1}", | ||
"100487451443373281118": "{\"id\":\"100487451443373281118\",\"provider\":\"google\",\"profile\":{\"emails\":[{\"value\":\"[email protected]\",\"type\":\"account\"}]},\"authScheme\":\"google\",\"created\":\"2020-04-07T18:40:52.941Z\",\"userId\":1}" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright IBM Corp. 2020. All Rights Reserved. | ||
// Node module: @loopback/example-passport-login | ||
// This file is licensed under the MIT License. | ||
// License text available at https://opensource.org/licenses/MIT | ||
|
||
const application = require('./dist'); | ||
|
||
module.exports = application; | ||
|
||
if (require.main === module) { | ||
// Run the application | ||
const config = { | ||
rest: { | ||
port: +(process.env.PORT || 3000), | ||
host: process.env.HOST, | ||
protocol: 'http', | ||
gracePeriodForClose: 5000, // 5 seconds | ||
openApiSpec: { | ||
// useful when used with OpenAPI-to-GraphQL to locate your application | ||
setServersFromRequest: true, | ||
}, | ||
// Use the LB4 application as a route. It should not be listening. | ||
listenOnStart: false, | ||
}, | ||
}; | ||
application.main(config).catch(err => { | ||
console.error('Cannot start the application.', err); | ||
process.exit(1); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './src'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"facebook-login": { | ||
"provider": "facebook", | ||
"module": "passport-facebook", | ||
"profileFields": ["gender", "link", "locale", "name", "timezone", | ||
"verified", "email", "updated_time", "displayName", "id"], | ||
"clientID": "{facebook-client-id}", | ||
"clientSecret": "ad4315e3453b012f6e4b8dd4bc1c0ae6", | ||
"callbackURL": "/api/auth/thirdparty/facebook/callback", | ||
"authPath": "/api/auth/thirdparty/facebook", | ||
"callbackPath": "/api/auth/thirdparty/facebook/callback", | ||
"successRedirect": "/auth/account", | ||
"failureRedirect": "/login", | ||
"scope": ["email"], | ||
"failureFlash": true | ||
}, | ||
"google-login": { | ||
"provider": "google", | ||
"module": "passport-google-oauth2", | ||
"strategy": "OAuth2Strategy", | ||
"clientID": "{google-client-id}", | ||
"clientSecret": "FcldSqY5-9usqlRmQhZawN__", | ||
"callbackURL": "/api/auth/thirdparty/google/callback", | ||
"authPath": "/api/auth/thirdparty/google", | ||
"callbackPath": "/api/auth/thirdparty/google/callback", | ||
"successRedirect": "/auth/account", | ||
"failureRedirect": "/login", | ||
"scope": ["email", "profile"], | ||
"failureFlash": true | ||
}, | ||
"oauth2": { | ||
"provider": "oauth2", | ||
"module": "passport-google-oauth2", | ||
"strategy": "OAuth2Strategy", | ||
"clientID": "{google-client-id}", | ||
"clientSecret": "FcldSqY5-9usqlRmQhZawN__", | ||
"callbackURL": "/api/auth/thirdparty/google/callback", | ||
"authPath": "/api/auth/thirdparty/google", | ||
"callbackPath": "/api/auth/thirdparty/google/callback", | ||
"successRedirect": "/auth/account", | ||
"failureRedirect": "/login", | ||
"scope": ["email", "profile"], | ||
"failureFlash": true, | ||
"authorizationURL": "https://localhost:8080", | ||
"tokenURL": "https://localhost:8080" | ||
} | ||
} |
Oops, something went wrong.