question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Disabling synchronization on authentication doesn't work

See original GitHub issue

I’ve all of a sudden started getting an error of app.emit is not a function when users try to log in. I’ve not be able to work out exactly why but figured it was something to do with feathers-sync. So I’ve tried to disable it in my authentication hooks but it has no effect.

app.service('authentication').hooks({
    before: {
      create: [
        lowerCase('email'),
        authentication.hooks.authenticate(config.strategies),
        customizeJWTPayload()
      ]
    },
    after: {
      create: [
        context => {
          context[SYNC] = false;
          return context;
        }
      ]
    }
  });

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
dafflcommented, Jan 31, 2019

Fixed in v1.1.1

1reaction
dottodotcommented, Jan 23, 2019

In fact I don’t think disabling synchronization works at all just tried on another service and ctx[SYNC] is always undefined.

app.mixins.push((service, path) => {
    service._emit = service.emit;
    service.mixin({
      emit(event, data, ctx) {
        console.log(ctx[SYNC]);

        const disabled = ctx && ctx[SYNC] === false;

        if (!service._serviceEvents.includes(event) || disabled) {
          debug(`Passing through non-service event '${path} ${event}'`);
          return this._emit(event, data, ctx);
        }

        const context = hooks.isHookObject(ctx)
          ? _.omit(ctx, 'app', 'service')
          : ctx;

        debug(`Sending sync-out event '${path} ${event}'`);

        return app.emit('sync-out', {
          event,
          path,
          data,
          context
        });
      }
    });
  });
Read more comments on GitHub >

github_iconTop Results From Across the Web

Password Hash Sync is automatically enabled during Azure ...
Run Azure AD Connect, and then select View current configuration. In the details pane, check whether Password synchronization is enabled on your ...
Read more >
Fix account sync issues - Android Help - Google Support
If your phone is having problems syncing with your Google Account, you could see a message, "Sync is currently experiencing problems.
Read more >
Disabling password sync entirely - No password field #104
Hi, I'm connected to the AD server and works well, but there's problem in syncing AD's username and password to database while we...
Read more >
Disable Chrome / Google Login synchronisation - Super User
Google Chrome now logs you into the browser whenever you log into a google service. You can disable this controversial feature by opening ......
Read more >
Disabling Time Synchronization for virtual machines (1189)
VMware Tools does not set time backwards (when guest time is ahead of the host), except once when periodic time synchronization is turned...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found