nodebb-plugin-sso-github 3.0.3 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/library.js +5 -7
- package/package.json +2 -2
- package/templates/admin/plugins/sso-github.tpl +41 -40
package/library.js
CHANGED
|
@@ -205,18 +205,16 @@
|
|
|
205
205
|
};
|
|
206
206
|
|
|
207
207
|
GitHub.init = function(data, callback) {
|
|
208
|
-
|
|
208
|
+
const hostHelpers = require.main.require('./src/routes/helpers');
|
|
209
209
|
|
|
210
|
-
function
|
|
210
|
+
hostHelpers.setupAdminPageRoute(data.router, '/admin/plugins/sso-github', function (req, res) {
|
|
211
211
|
res.render('admin/plugins/sso-github', {
|
|
212
|
+
title: constants.name,
|
|
212
213
|
callbackURL: nconf.get('url') + '/auth/github/callback'
|
|
213
214
|
});
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
data.router.get('/admin/plugins/sso-github', data.middleware.admin.buildHeader, renderAdmin);
|
|
217
|
-
data.router.get('/api/admin/plugins/sso-github', renderAdmin);
|
|
215
|
+
});
|
|
218
216
|
|
|
219
|
-
hostHelpers.setupPageRoute(data.router, '/deauth/github',
|
|
217
|
+
hostHelpers.setupPageRoute(data.router, '/deauth/github', [data.middleware.requireUser], function (req, res) {
|
|
220
218
|
res.render('plugins/sso-github/deauth', {
|
|
221
219
|
service: "GitHub",
|
|
222
220
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nodebb-plugin-sso-github",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "NodeBB GitHub SSO",
|
|
5
5
|
"main": "library.js",
|
|
6
6
|
"repository": {
|
|
@@ -46,6 +46,6 @@
|
|
|
46
46
|
"passport-github2": "^0.1.9"
|
|
47
47
|
},
|
|
48
48
|
"nbbpm": {
|
|
49
|
-
"compatibility": "^3.
|
|
49
|
+
"compatibility": "^3.2.0"
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -1,45 +1,46 @@
|
|
|
1
|
-
<div class="
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<div class="mb-3">
|
|
10
|
-
<label for="id">Client ID</label>
|
|
11
|
-
<input type="text" name="id" title="Client ID" class="form-control" placeholder="Client ID">
|
|
12
|
-
</div>
|
|
13
|
-
<div class="mb-3">
|
|
14
|
-
<label for="secret">Client Secret</label>
|
|
15
|
-
<input type="text" name="secret" title="Client Secret" class="form-control" placeholder="Client Secret" />
|
|
1
|
+
<div class="acp-page-container">
|
|
2
|
+
<!-- IMPORT admin/partials/settings/header.tpl -->
|
|
3
|
+
|
|
4
|
+
<div class="row m-0">
|
|
5
|
+
<div id="spy-container" class="col-12 px-0 mb-4" tabindex="0">
|
|
6
|
+
<div class="alert alert-info">
|
|
7
|
+
Register a new <strong>GitHub Application</strong> via
|
|
8
|
+
<a href="https://github.com/settings/developers">Developer Applications</a> and then paste your application details here.
|
|
16
9
|
</div>
|
|
17
|
-
<
|
|
18
|
-
<
|
|
19
|
-
|
|
10
|
+
<form class="sso-github-settings">
|
|
11
|
+
<div class="mb-3">
|
|
12
|
+
<label for="id">Client ID</label>
|
|
13
|
+
<input type="text" name="id" title="Client ID" class="form-control" placeholder="Client ID">
|
|
14
|
+
</div>
|
|
15
|
+
<div class="mb-3">
|
|
16
|
+
<label for="secret">Client Secret</label>
|
|
17
|
+
<input type="text" name="secret" title="Client Secret" class="form-control" placeholder="Client Secret" />
|
|
18
|
+
</div>
|
|
19
|
+
<div class="mb-3 alert alert-warning">
|
|
20
|
+
<label for="callback">Your NodeBB's "Authorization callback URL"</label>
|
|
21
|
+
<input type="text" id="callback" title="Authorization callback URL" class="form-control" value="{callbackURL}" readonly />
|
|
22
|
+
<p class="form-text">
|
|
23
|
+
Ensure that this value is set in your GitHub application's settings
|
|
24
|
+
</p>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="form-check">
|
|
27
|
+
<input type="checkbox" class="form-check-input" id="disableRegistration" name="disableRegistration" />
|
|
28
|
+
<label for="disableRegistration" class="form-check-label">
|
|
29
|
+
Disable user registration via SSO
|
|
30
|
+
</label>
|
|
31
|
+
</div>
|
|
32
|
+
<div class="form-check">
|
|
33
|
+
<input type="checkbox" class="form-check-input" id="needToVerifyEmail" name="needToVerifyEmail" />
|
|
34
|
+
<label for="needToVerifyEmail" class="form-check-label">
|
|
35
|
+
Need user to verify email
|
|
36
|
+
</label>
|
|
37
|
+
</div>
|
|
20
38
|
<p class="form-text">
|
|
21
|
-
|
|
39
|
+
Restricting registration means that only registered users can associate their account with this SSO strategy.
|
|
40
|
+
This restriction is useful if you have uesrs bypassing registration controls by using social media accounts, or
|
|
41
|
+
if you wish to use the NodeBB registration queue.
|
|
22
42
|
</p>
|
|
23
|
-
</
|
|
24
|
-
|
|
25
|
-
<input type="checkbox" class="form-check-input" id="disableRegistration" name="disableRegistration" />
|
|
26
|
-
<label for="disableRegistration" class="form-check-label">
|
|
27
|
-
Disable user registration via SSO
|
|
28
|
-
</label>
|
|
29
|
-
</div>
|
|
30
|
-
<div class="form-check">
|
|
31
|
-
<input type="checkbox" class="form-check-input" id="needToVerifyEmail" name="needToVerifyEmail" />
|
|
32
|
-
<label for="needToVerifyEmail" class="form-check-label">
|
|
33
|
-
Need user to verify email
|
|
34
|
-
</label>
|
|
35
|
-
</div>
|
|
36
|
-
<p class="form-text">
|
|
37
|
-
Restricting registration means that only registered users can associate their account with this SSO strategy.
|
|
38
|
-
This restriction is useful if you have uesrs bypassing registration controls by using social media accounts, or
|
|
39
|
-
if you wish to use the NodeBB registration queue.
|
|
40
|
-
</p>
|
|
41
|
-
</form>
|
|
43
|
+
</form>
|
|
44
|
+
</div>
|
|
42
45
|
</div>
|
|
43
46
|
</div>
|
|
44
|
-
|
|
45
|
-
<!-- IMPORT admin/partials/save_button.tpl -->
|