Conversation
1. add google Play Games Authentication Method(different from Google due to GPG is using a new ID method). 2. add Game Center Authentication Method. By refering to the URL that provided: https://developer.apple.com/documentation/gamekit/gklocalplayer/1515407-generateidentityverificationsign?language=objc
check using the funciton hasOwnProperty.
fix error for Google Play Games.
Temporary enable this to allow PR Success
1. remove old rest.spec test as it is actually wrong. 2. added the test at AuthenticationAdapters.spec.js. 3. put back the index.js change to search for where to change exactly.
Codecov Report
@@ Coverage Diff @@
## master #4484 +/- ##
==========================================
- Coverage 92.8% 91.97% -0.83%
==========================================
Files 118 121 +3
Lines 8394 8515 +121
==========================================
+ Hits 7790 7832 +42
- Misses 604 683 +79
Continue to review full report at Codecov.
|
src/Adapters/Auth/index.js
Outdated
|
|
||
| var _AdapterLoader2 = _interopRequireDefault(_AdapterLoader); | ||
|
|
||
| function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
There was a problem hiding this comment.
Looks like you copied compiled babel. Doesn't look like something humans write.
src/Adapters/Auth/index.js
Outdated
| xiaomi | ||
| }; | ||
|
|
||
| function authDataValidator(adapter, appIds, options) |
There was a problem hiding this comment.
Sticking to the current coding style / ES6 would be ideal.
src/Adapters/Auth/index.js
Outdated
| const providerOptions = authOptions[provider]; | ||
|
|
||
| if (!defaultAdapter && !providerOptions) { | ||
| if (!defaultAdapter && !providerOptions) |
There was a problem hiding this comment.
Its recommended to always use brackets for if / else statements. Without them they can lead to bugs. You might want to go over your code again for consistency
src/Adapters/Auth/index.js
Outdated
| // Try the configuration methods | ||
| if (providerOptions) { | ||
| const optionalAdapter = loadAdapter(providerOptions, undefined, providerOptions); | ||
| const optionalAdapter = (0, _AdapterLoader2.default)(providerOptions, undefined, providerOptions); |
|
already changed accordingly. Please let me know if there is anything else. |
There was a problem hiding this comment.
There's a lot of things that need to be changed here. For starters if you can undo those stylistic changes that will make it much easier for us to stay focused on just the functional changes you're introducing.
If you do feel you want to introduce stylistic changes to existing code, and have justification for doing so, feel free to open up a separate PR specifically for doing that.
::edit:: Additionally diff coverage by this PR is negative. You'll need to inspect the coverage results and account for untested code paths, which may involve adjusting your code to make it testable.
| return Promise.resolve(); | ||
| }); | ||
| } | ||
| }; |
There was a problem hiding this comment.
Can you revert these style changes?
Generally you should avoid unnecessary stylistic changes when adding a feature unless it's part of the change itself (i.e. specifically a stylistic change PR). In this case it's superfluous and adds to what we have to review. It'll make it much easier for us to go through and review your changes if they're only functional changes.
| const optionalAdapter = loadAdapter(providerOptions, undefined, providerOptions); | ||
| if (optionalAdapter) { | ||
| ['validateAuthData', 'validateAppId'].forEach((key) => { | ||
| ['validateAuthData', 'validateAppId'].forEach(key => { |
There was a problem hiding this comment.
Same here. This can and should be suggested separately.
| } | ||
|
|
||
| return {adapter, appIds, providerOptions}; | ||
| return { adapter, appIds, providerOptions }; |
| // To handle the test cases on configuration | ||
| const getValidatorForProvider = function(provider) { | ||
| const getValidatorForProvider = function (provider) | ||
| { |
| }) | ||
| } | ||
| }); | ||
| }; |
There was a problem hiding this comment.
Not needed for this PR, let's kept it focused on what you're actually introducing.
|
|
||
| // Returns a promise that fulfills if this user id is valid. | ||
| function validateAuthData(authData, authOptions) | ||
| { |
There was a problem hiding this comment.
again, keep the curly braces up on the same line. It's inconsistent throughout this file as well if you can amend that.
| var crypto = require('crypto'); | ||
|
|
||
| const PRODUCTION_URL = "https://cn-api.unity.com"; | ||
| const DEBUG_URL = " https://cn-api-debug.unity.com"; |
There was a problem hiding this comment.
This url doesn't seem right, xiaomi is unity? Can you clarify this 3rd party provider and the urls?
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Added the following Authentication Provider: