Skip to content

Commit b48c270

Browse files
authored
refactor: Improve incorrect deprecation log message for auth adapter (#8347)
1 parent 536bb2f commit b48c270

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

spec/AuthenticationAdapters.spec.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -590,16 +590,17 @@ describe('AuthenticationProviders', function () {
590590
);
591591
});
592592

593-
it('can depreciate', async () => {
593+
it('can deprecate', async () => {
594594
await reconfigureServer();
595595
const Deprecator = require('../lib/Deprecator/Deprecator');
596596
const spy = spyOn(Deprecator, 'logRuntimeDeprecation').and.callFake(() => {});
597597
const provider = getMockMyOauthProvider();
598598
Parse.User._registerAuthenticationProvider(provider);
599599
await Parse.User._logInWith('myoauth');
600600
expect(spy).toHaveBeenCalledWith({
601-
usage: 'auth.myoauth',
602-
solution: 'auth.myoauth.enabled: true',
601+
usage: 'Using the authentication adapter "myoauth" without explicitly enabling it',
602+
solution:
603+
'Enable the authentication adapter by setting the Parse Server option "auth.myoauth.enabled: true".',
603604
});
604605
});
605606
});

src/Auth.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,8 @@ const handleAuthDataValidation = async (authData, req, foundUser) => {
435435
const authProvider = (req.config.auth || {})[provider] || {};
436436
if (authProvider.enabled == null) {
437437
Deprecator.logRuntimeDeprecation({
438-
usage: `auth.${provider}`,
439-
solution: `auth.${provider}.enabled: true`,
438+
usage: `Using the authentication adapter "${provider}" without explicitly enabling it`,
439+
solution: `Enable the authentication adapter by setting the Parse Server option "auth.${provider}.enabled: true".`,
440440
});
441441
}
442442
if (!validator || authProvider.enabled === false) {

0 commit comments

Comments
 (0)