Socket
Socket
Sign inDemoInstall

tent-login

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tent-login

Utility to make Tent logins super easy for web apps.


Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

tent-login

Utility to make Tent logins super easy for web apps. By opening a popup, the login page won't be left and you can handle success and error events simply by waiting for a callback.
To circumvent CORS restrictions this library relies on a server that proxies the discover request. You could use tent-discover-proxy for this.
You can either use browserify or download a standalone build here to load this module into the browser.
Take a look at the example for further inspiration.

install

With npm:

npm install tent-login --save

Or download the latest build here.

usage

var login = require('tent-login')

// suppose this is called when the login form is submitted
function onSubmit(e) {
	
	e.preventDefault()

	var entity = document.getElementById('entity').value

	var opts = {

		// schema details [here](https://tent.io/docs/post-types#meta)
		app: { 
			name: 'Test App',
			url: 'http://tent.example.com',
			types: {
				read: [ 'all' ],
				write: [ 'all' ]
			}
		},

		// formated using nodes' `util.format` function. `%s` replaced by the entity to discover
		proxy: 'http://discoverproxy.example.com?entity=%s'
	}

	login(entity, opts, function(err, user) {
		if(err) console.error(err)

		// `user` is an object containing `auth`, `meta` and `appId` keys
		else console.log(user)
	})
}

license

MIT

FAQs

Package last updated on 28 Feb 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc