diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..c8a2299 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,24 @@ +{ + "env": { + "meteor": true + }, + "globals": { + "Steam": false + }, + "rules": { + "indent": [2, 2, {"SwitchCase": 1}], + "eqeqeq": 2, + "curly": 2, + "quotes": [2, "single"], + "no-unused-vars": 2, + "no-undef": 2, + "no-multi-spaces": 2, + "no-empty": 2, + "comma-dangle": [2, "never"], + "semi": [2, "always"], + "wrap-iife": [2, "inside"], + "linebreak-style": 2, + "comma-spacing": [2, {"before": false, "after": true}], + "no-spaced-func": 2 + } +} diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index 1fb4ca8..0000000 --- a/.jshintrc +++ /dev/null @@ -1,39 +0,0 @@ -{ - "globals": { - "Meteor": false, - "DDP": false, - "Mongo": false, - "Session": false, - "Accounts": false, - "Template": false, - "Blaze": false, - "UI": false, - "Match": false, - "check": false, - "Tracker": false, - "Deps": false, - "ReactiveVar": false, - "EJSON": false, - "HTTP": false, - "Email": false, - "Assets": false, - "Handlebars": false, - "Package": false, - "App": false, - - "DDPServer": false, - "global": false, - "Log": false, - "MongoInternals": false, - "process": false, - "WebApp": false, - "WebAppInternals": false, - - "Npm": false, - "Tinytest": false, - "Random": false, - "_": false, - "$": false, - "Router": false - } -} diff --git a/LICENSE b/LICENSE index ecd81f9..e9266b3 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 Michael Scholtz +Copyright (c) 2015+ Michael Scholtz Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index c315a8e..60557c1 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,10 @@ # Steam OpenID integration for Meteor Accounts -Atmosphere is filled with over dozen Steam packages which provide this functionality, however most of these packages are either outdated or lack even the basic description, such as a README file. +This package provides seamless integration of Meteor accounts system with Steam's OpenID provider. -Tested with **Meteor 1.4.0.1** so far. The development of this package is not active because it just works. +Tested with **Meteor 1.4.1.2** so far. + +Check out [meteor-accounts-steam-example](https://github.com/scholtz/meteor-accounts-steam-example) for a basic example. ## Installation @@ -10,12 +12,8 @@ Tested with **Meteor 1.4.0.1** so far. The development of this package is not ac ## Usage -`Meteor.loginWithSteam(options, callback)` +`Meteor.loginWithSteam(options)` * `options` - object containing options, see below (optional) -* `callback` - callback function (optional) - * `error` - `Meteor.Error` object if error occured; `null` otherwise - -*Note:* `callback` will be only called if `loginStyle` is set to `popup` #### Example @@ -31,11 +29,8 @@ Template.myTemplateName.events({ These options override service configuration stored in the database. -* `loginStyle` - `redirect` or `popup` * `redirectUrl` - where to redirect after successful login -*Note:* `redirectUrl` will be used only if `loginStyle` is set to `redirect` - The value below can be only set via Accounts UI dialog or by inserting the service configuration directly to database: * `timeout` - timeout value (in milliseconds) for the OpenID handshake @@ -46,6 +41,8 @@ This package integrates with `accounts-ui` and also provides configuration dialo You can also skip the config dialog by running a short snippet in your `Meteor.startup` function, see below. +**NOTE:** Always choose redirect-based login flow. This package does not support logging in through popup. + ## Manual configuration setup You can manually configure this package by upserting the service configuration on startup. First, add the service configuration package: @@ -61,8 +58,8 @@ if(Meteor.isServer) { { service: 'steam' }, { $set: { - loginStyle: 'redirect', - timeout: 10000 // 10 seconds + loginStyle: 'redirect', // THIS MUST BE SET TO REDIRECT + timeout: 10000 // 10 seconds } } ); @@ -82,6 +79,8 @@ Ideally, you should at least retrieve user's profile information when he logs in If you wish to keep user's profile up-to-date, you can use [`Accounts.onLogin` (server-side)](http://docs.meteor.com/#/full/accounts_onlogin) or different approach. +There are plenty of other account hooks, check out [official Meteor docs](https://docs.meteor.com/). + ## LICENSE MIT. See `LICENSE`. diff --git a/package.js b/package.js index 9299cd2..747dcf7 100644 --- a/package.js +++ b/package.js @@ -1,6 +1,6 @@ Package.describe({ name: 'scholtzm:accounts-steam', - version: '1.1.1', + version: '1.2.0', summary: 'Steam OpenID integration for Meteor Accounts', git: 'https://github.com/scholtzm/meteor-accounts-steam', documentation: 'README.md' @@ -13,7 +13,7 @@ Package.onUse(function(api) { api.imply('accounts-base', ['client', 'server']); api.use('accounts-oauth', ['client', 'server']); - api.use('scholtzm:steam@1.1.0', ['client', 'server']); + api.use('scholtzm:steam@1.2.0', ['client', 'server']); api.addFiles(['steam_login_button.css'], 'client'); api.addFiles('steam_common.js', ['client', 'server']);