https://github.com/doubleleft/hook-javascript-oauth
OAuth plugin for JavaScript Hook.Client.
https://github.com/doubleleft/hook-javascript-oauth
Last synced: 26 days ago
JSON representation
OAuth plugin for JavaScript Hook.Client.
- Host: GitHub
- URL: https://github.com/doubleleft/hook-javascript-oauth
- Owner: doubleleft
- License: mit
- Created: 2015-07-16T17:44:05.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-07-16T19:01:54.000Z (almost 11 years ago)
- Last Synced: 2026-03-25T16:47:30.886Z (3 months ago)
- Language: JavaScript
- Size: 125 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
hook-javascript-oauth
===
[hook-javascript](https://github.com/doubleleft/hook-javascript) plugin for
OAuth integration. With less than 5kb minified.
How to use
---
View
[documentation](http://doubleleft.github.io/hook-userguide/The-Basics/Authentication/#oauth)
for configuration examples.
```javascript
var hook = new Hook.Client({/* browser credentials */})
// login with twitter
$('#twitter-login').click(function(e) {
hook.oauth.popup('twitter').then(function(data) {
console.log("Success!", data);
}).otherwise(function(err) {
console.log("Canceled!", err);
});
});
// login with facebook
$('#facebook-login').click(function(e) {
hook.oauth.popup('facebook').then(function(data) {
console.log("Success!", data);
}).otherwise(function(err) {
console.log("Canceled!", err);
});
});
```
Building
---
```bash
npm install
npm run build
```
License
---
MIT