Skip to content

Commit 69864d5

Browse files
authored
feat: add egg-passport-yuque example (#104)
passport plugin pull request: eggjs-community/egg-passport-yuque#1
1 parent 5badee9 commit 69864d5

File tree

6 files changed

+16
-2
lines changed

6 files changed

+16
-2
lines changed

passport/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
- GitHub: http://127.0.0.1:7001/passport/github
77
- Bitbucket: http://127.0.0.1:7001/passport/bitbucket
88
- Twitter: http://127.0.0.1:7001/passport/twitter
9+
- YuQue: http://127.0.0.1:7001/passport/yuque

passport/app/controller/home.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ class HomeController extends Controller {
2323
<hr>
2424
Login with
2525
<a href="/passport/weibo">Weibo</a> | <a href="/passport/github">Github</a> |
26-
<a href="/passport/bitbucket">Bitbucket</a> | <a href="/passport/twitter">Twitter</a>
26+
<a href="/passport/bitbucket">Bitbucket</a> | <a href="/passport/twitter">Twitter</a> |
27+
<a href="/passport/yuque">YuQue 语雀</a>
2728
<hr>
2829
<a href="/">Home</a> | <a href="/user">User</a>
2930
</div>

passport/app/router.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module.exports = app => {
88
app.passport.mount('github');
99
app.passport.mount('bitbucket');
1010
app.passport.mount('twitter');
11+
app.passport.mount('yuque');
1112

1213
app.router.get('/logout', 'user.logout');
1314
};

passport/config/config.default.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,8 @@ exports.passportTwitter = {
2222
key: 'g',
2323
secret: 'h',
2424
};
25+
26+
exports.passportYuque = {
27+
key: process.env.EGG_PASSPORT_YUQUE_CLIENT_ID || 'i',
28+
secret: process.env.EGG_PASSPORT_YUQUE_CLIENT_SECRET || 'j',
29+
};

passport/config/plugin.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,8 @@ exports.passportBitbucket = {
2424
enable: true,
2525
package: 'egg-passport-bitbucket',
2626
};
27+
28+
exports.passportYuque = {
29+
enable: true,
30+
package: 'egg-passport-yuque',
31+
};

passport/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"egg-passport-bitbucket": "^1.0.0",
77
"egg-passport-github": "^1.0.0",
88
"egg-passport-twitter": "^1.0.0",
9-
"egg-passport-weibo": "^1.0.0"
9+
"egg-passport-weibo": "^1.0.0",
10+
"egg-passport-yuque": "^1.0.0"
1011
},
1112
"devDependencies": {
1213
"egg-bin": "^4.3.5"

0 commit comments

Comments
 (0)