Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socket client should automatically auth on reconnect #310

Closed
marshallswain opened this Issue Oct 13, 2016 · 1 comment

Comments

Projects
None yet
1 participant
@marshallswain
Copy link
Member

marshallswain commented Oct 13, 2016

I'm in the process of making a new version of can-connect-feathers that uses the real feathers-client. This is something that probably ought to be in the feathers-auth client.

  /**
   * When the socket gets disconnected, this makes sure that it re-authenticates
   * upon reconnection. It simply calls `authenticateSocket` and persists
   * the token.
   */
  handleSocketReconnects(data){
    // Make sure the socket re-authenticates if it gets disconnected.
    this.io.on('reconnect', () => {
      this.authenticateSocket(data)
        .then(data => this.persistToken(data))
        .then(data => this.makeSSRCookie(data));
    });
  }
@marshallswain

This comment has been minimized.

Copy link
Member Author

marshallswain commented Oct 23, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.