mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Add allow signup option to GitHub OAuth
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
|
||||
* `github-oauth@1.4.0`
|
||||
- More data will be retrieved and saved under `services.github` on the user account.
|
||||
- Add option to disallow sign-up on GitHub using `allow_signup` [parameter](https://docs.github.com/en/developers/apps/building-oauth-apps/authorizing-oauth-apps#parameters), this will be activated based on your Accounts settings, specifically if the option `forbidClientAccountCreation` is set to `true`.
|
||||
|
||||
#### Independent Releases
|
||||
|
||||
|
||||
@@ -25,12 +25,17 @@ Github.requestCredential = (options, credentialRequestCompleteCallback) => {
|
||||
|
||||
const loginStyle = OAuth._loginStyle('github', config, options);
|
||||
|
||||
let allowSignup = '';
|
||||
if (Accounts._options?.forbidClientAccountCreation)
|
||||
allowSignup = '&allow_signup=false'; // https://docs.github.com/en/developers/apps/building-oauth-apps/authorizing-oauth-apps#parameters
|
||||
|
||||
const loginUrl =
|
||||
'https://github.com/login/oauth/authorize' +
|
||||
`?client_id=${config.clientId}` +
|
||||
`&scope=${flatScope}` +
|
||||
`&redirect_uri=${OAuth._redirectUri('github', config)}` +
|
||||
`&state=${OAuth._stateParam(loginStyle, credentialToken, options && options.redirectUrl)}`;
|
||||
`&state=${OAuth._stateParam(loginStyle, credentialToken, options && options.redirectUrl)}` +
|
||||
allowSignup;
|
||||
|
||||
OAuth.launchLogin({
|
||||
loginService: "github",
|
||||
|
||||
Reference in New Issue
Block a user