Skip to content

Commit

Permalink
feat: add egg-passport-yuque example (eggjs#104)
Browse files Browse the repository at this point in the history
passport plugin pull request: eggjs-community/egg-passport-yuque#1
  • Loading branch information
fengmk2 authored Apr 30, 2019
1 parent 5badee9 commit 69864d5
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions passport/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
- GitHub: http://127.0.0.1:7001/passport/github
- Bitbucket: http://127.0.0.1:7001/passport/bitbucket
- Twitter: http://127.0.0.1:7001/passport/twitter
- YuQue: http://127.0.0.1:7001/passport/yuque
3 changes: 2 additions & 1 deletion passport/app/controller/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ class HomeController extends Controller {
<hr>
Login with
<a href="/passport/weibo">Weibo</a> | <a href="/passport/github">Github</a> |
<a href="/passport/bitbucket">Bitbucket</a> | <a href="/passport/twitter">Twitter</a>
<a href="/passport/bitbucket">Bitbucket</a> | <a href="/passport/twitter">Twitter</a> |
<a href="/passport/yuque">YuQue 语雀</a>
<hr>
<a href="/">Home</a> | <a href="/user">User</a>
</div>
Expand Down
1 change: 1 addition & 0 deletions passport/app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = app => {
app.passport.mount('github');
app.passport.mount('bitbucket');
app.passport.mount('twitter');
app.passport.mount('yuque');

app.router.get('/logout', 'user.logout');
};
5 changes: 5 additions & 0 deletions passport/config/config.default.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ exports.passportTwitter = {
key: 'g',
secret: 'h',
};

exports.passportYuque = {
key: process.env.EGG_PASSPORT_YUQUE_CLIENT_ID || 'i',
secret: process.env.EGG_PASSPORT_YUQUE_CLIENT_SECRET || 'j',
};
5 changes: 5 additions & 0 deletions passport/config/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,8 @@ exports.passportBitbucket = {
enable: true,
package: 'egg-passport-bitbucket',
};

exports.passportYuque = {
enable: true,
package: 'egg-passport-yuque',
};
3 changes: 2 additions & 1 deletion passport/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"egg-passport-bitbucket": "^1.0.0",
"egg-passport-github": "^1.0.0",
"egg-passport-twitter": "^1.0.0",
"egg-passport-weibo": "^1.0.0"
"egg-passport-weibo": "^1.0.0",
"egg-passport-yuque": "^1.0.0"
},
"devDependencies": {
"egg-bin": "^4.3.5"
Expand Down

0 comments on commit 69864d5

Please sign in to comment.