gitkit-widgets
Convenience library for initializing Google Identity Toolkit widgets
Last updated 6 years ago by phated .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install gitkit-widgets 
SYNC missed versions from official npm registry.

gitkit-widgets

Travis Build Status

Convenience library for initializing Google Identity Toolkit widgets

Usage

var gitkit = require('gitkit-widgets');

var config = {
  loginUrl: '/login',
  logoutUrl: '/',
  popup: true
};

gitkit.login('#loginButton', config, function(err){
  // button is ready
});

API

login(selector, [options], [callback])

Attach a login widget, configured by options, to all elements that match the selector.

selector

Any valid selector to pass to document.querySelectorAll.

options

Optional configuration for the login button. Takes any of the Gitkit widget options or nicer options as defined below.

Note: all Gitkit widget option names take precedence over the names below.

options.loginUrl (default: '/login')

The location a user is redirected to during login. The location must contain a login widget.

options.logoutUrl (default: '/')

The location a user is redirected to during logout.

options.popup (default: false)

Whether the login page should show in a popup or not.

options.cookie (default: 'gtoken')

The cookie where a user's login token is saved.

callback

Optional callback that is invoked upon completion of login button construction.

License

MIT

Current Tags

  • 0.1.1                                ...           latest (6 years ago)

2 Versions

  • 0.1.1                                ...           6 years ago
  • 0.1.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 2
Dependencies (3)
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |