1.0.0 • Published 8 years ago

meteor-subdomain-persistent-login v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

Subdomain login persistence for your meteor apps

To install this in your meteor 1.3 app:

npm install --save meteor-subdomain-persistent-login

In your main client javascript file:

import initSubdomainPersistentLogin from 'meteor-subdomain-persistent-login'

Meteor.startup(() => {
  initSubdomainPersistentLogin(Meteor, ['app.localhost'])
})

This will set the cookie for all subdomains of app.localhost and app.localhost itself.

Replace app.localhost with your domain. If you host your app on multiple domains you can even give a list of domains. However the login will not persist between domains, because that is not possible with cookies.

Configuration

initSubdomainPersistentLogin takes an object as a optional third argument, containing further configuration data:

initSubdomainPersistentLogin(
  Meteor,
  ['app.localhost'],
  {
    expiresAfterDays: 30,
    cookieName: 'meteor_subdomain_token'
  }
)
  • expiresAfterDays : After how many days the cookie will expire (default: 30).
  • cookieName: Which name to use for the cookie (default: "meteor_subdomain_token").
1.0.0

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago