Skip to content

Add Social Login support#46

Merged
timothyej merged 5 commits intomasterfrom
feature-social-login
Mar 21, 2016
Merged

Add Social Login support#46
timothyej merged 5 commits intomasterfrom
feature-social-login

Conversation

@typerandom
Copy link
Copy Markdown
Contributor

Add support for social login with the SocialLoginLink and SocialLoginButton components.

Note

This depends on stormpath/express-stormpath#374 in order for Facebook to be supported.

How to verify

  1. Checkout this branch.
  2. Build it ($ npm run build).
  3. Link it ($ npm link).
  4. Checkout the social-login branch of the React example app.
  5. Link to our React SDK feature branch ($ npm link react-stormpath).
  6. Log into the Stormpath Console and configure/map the Facebook, Google, Github and LinkedIn social provider directories for your application.
  7. Start the application ($ npm start).
  8. Navigate to /login.
  9. Verify that all of the mapped social providers are visible below a box called Or login with....
  10. Click each provider and verify that you can login with them. Note that for Facebook, you need to patch the example application with the branch of this express-stormpath PR. Or else it won't work.
  11. Login to the Stormpath Console, and unmap one provider at a time while restarting the app and verifying that they are removed from the Or login with... box.
  12. When all providers are unmapped, verify that the Or login with... box disappears.
  13. Using the documentation, open up the example application and manually add your own SocialLoginLink and SocialLoginButton.
  14. Verify that the link/button works as expected.

Fixes #14.

Comment thread docs/api.md

**Note:** The same options that are supported by the `SocialLoginLink` component are also supported by this.

**Important:** This component relies on [Font Awesome](http://fortawesome.github.io/Font-Awesome/) in order to render icons for the various social providers. So if you want to use this button with icons, you also need to install Font Awesome on your site.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to add Font Awesome to the example project :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's actually added, didn't you try it with the social-login branch? :)
https://github.com/stormpath/stormpath-express-react-example/tree/social-login/build/fonts

@timothyej
Copy link
Copy Markdown
Contributor

In the AngularJS SDK we've also displaying the buttons on the registrations form, but you are only showing it on the login form.

And also, the AngularJS SDK have colored buttons, while yours are just white.

What's your thoughts on that?

Comment thread docs/api.md Outdated
<SocialLoginLink providerId='facebook'>Sign in with Facebook</SocialLoginLink>
```

Renders a link that can be used to sign into a social provider.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renders a link that can be used to sign into a social provider.

The user doesn't sign in to a social provider, so it should probably be more like this:

Renders a link that can be used to sign in using a social provider.

@timothyej
Copy link
Copy Markdown
Contributor

Other than my comments this is really nice! 👍

@typerandom
Copy link
Copy Markdown
Contributor Author

@timothyej I personally see the social login buttons on the signup page as an anti pattern. But I'll add it for consistency. I personally don't think that the colors add much value, so I just decided to go without styling them in the first version. It can be added in a later version.

@timothyej
Copy link
Copy Markdown
Contributor

I personally see the social login buttons on the signup page as an anti pattern.

As a user I would never click on Login if I wouldn't already have an account, I would always click on Signup. But in this case I would not be able to signup with e.g. Facebook because that button would only be on the login page.

@typerandom typerandom force-pushed the feature-social-login branch from 2366313 to eb2d059 Compare March 12, 2016 09:08
@typerandom
Copy link
Copy Markdown
Contributor Author

@timothyej Comments have been fixed. Please review again :)

Comment thread src/components/SocialLoginLink.js Outdated
var providerId = this.props.providerId;

return (
<a {...this.props} href='#' className={this.props.className} onClick={this._onClick.bind(this)} disabled={this.state.disabled}>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably don't have to set className explicitly since you include all the properties using {...this.props}?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Will fix that! :)

@timothyej
Copy link
Copy Markdown
Contributor

I've verified that everything works as expected :) I will merge this once you've fixed my comment.

@typerandom
Copy link
Copy Markdown
Contributor Author

Sweeeet! :)

@typerandom
Copy link
Copy Markdown
Contributor Author

@timothyej This is now fixed.

timothyej pushed a commit that referenced this pull request Mar 21, 2016
@timothyej timothyej merged commit 0655183 into master Mar 21, 2016
@timothyej timothyej deleted the feature-social-login branch March 21, 2016 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants