Skip to content
This repository has been archived by the owner on Mar 22, 2022. It is now read-only.

Socket client should automatically auth on reconnect #310

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

Socket client should automatically auth on reconnect #310

marshallswain opened this issue Oct 13, 2016 · 1 comment

Comments

@marshallswain
Copy link
Member

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));
    });
  }
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant