Coder Social home page Coder Social logo

praveenmunagapati / login-fire Goto Github PK

View Code? Open in Web Editor NEW

This project forked from convoo/login-fire

0.0 1.0 0.0 358 KB

An element that allows simple configuration of multiple provider login for firebase

Home Page: https://webcomponents.org/element/convoo/login-fire

License: MIT License

HTML 100.00%

login-fire's Introduction

Login-Fire

login-fire

Simple way to add authentication to your app using Firebase Auth.


Overview & Demo

The following elements are available:

  • <login-fire-button> for single provider authentication
  • <login-fire-social> for multiple provider authentication
  • <login-fire-form> for email and password authentication
  • <login-fire> for all of the above.

The goal of the <login-fire> elements is to provide a simple to setup, elegant UI for authentication using Firebase Auth.

Our demo is available on webcomponents.org.

Note: login-fire is not associated with Firebase. This collection of components is based on polymerfire.

Install

bower install login-fire --save

<login-fire>

Add authentication with email and password as well as federated identity providers (Google, Facebook, Twitter, GitHub, Anonymous) to your app.

<link rel="import" href="/bower_components/login-fire/login-fire.html">
<firebase-app
  name="login"
  api-key="AIzaSyAhoCXxkY-ffNwA_7L7HIwBVpASYj1btNE"
  auth-domain="convoo-login-demo.firebaseapp.com"
  database-url="https://convoo-login-demo.firebaseio.com">
</firebase-app>

<login-fire
  app-name="login"
  providers="google, facebook, twitter, github, anonymous" 
  user="{{user}}"
  signed-in="{{signedIn}}">
</login-fire>

<login-fire-social>

Add multiple federated identity providers authentication to your app with Firebase Auth API.

<link rel="import" href="/bower_components/login-fire/login-fire-social.html">
<firebase-app
  name="social"
  api-key="AIzaSyAhoCXxkY-ffNwA_7L7HIwBVpASYj1btNE"
  auth-domain="convoo-login-demo.firebaseapp.com"
  database-url="https://convoo-login-demo.firebaseio.com">
</firebase-app>

<login-fire-social
  app-name="social"
  providers="google, facebook, twitter, github, anonymous" 
  user="{{user}}"
  signed-in="{{signedIn}}">
</login-fire-social>

<login-fire-form>

Add email-password authentication to your app with Firebase Auth API.

<link rel="import" href="/bower_components/login-fire/login-fire-form.html">
<firebase-app
  name="email"
  api-key="AIzaSyAhoCXxkY-ffNwA_7L7HIwBVpASYj1btNE"
  auth-domain="convoo-login-demo.firebaseapp.com"
  database-url="https://convoo-login-demo.firebaseio.com">
</firebase-app>

<login-fire-form
  app-name="email"
  user="{{user}}"
  signed-in="{{signedIn}}">
</login-fire-form>

<login-fire-button>

A button for a single federated identity provider (Google, Facebook, Twitter, GitHub, Anonymous) that allows users to sign-in to and sign-out from your app using Firebase Auth API.

<link rel="import" href="/bower_components/login-fire/login-fire-button.html">
<firebase-app
  name="button"
  api-key="AIzaSyAhoCXxkY-ffNwA_7L7HIwBVpASYj1btNE"
  auth-domain="convoo-login-demo.firebaseapp.com"
  database-url="https://convoo-login-demo.firebaseio.com">
</firebase-app>

<login-fire-button app-name="button" provider="google" user="{{user}}"></login-fire-button>
<login-fire-button app-name="button" provider="facebook" user="{{user}}"></login-fire-button>
<login-fire-button app-name="button" user="{{user}}"></login-fire-button>

Signing Out

To sign out, access a login-fire element and call its signOut function.

Example:

<a on-click="_signOut">Sign Out</a>
_signOut: function(e){
  this.$$('login-fire').signOut();
  // or
  // this.$$('login-fire-button').signOut();
  // or
  // this.$$('login-fire-social').signOut();
  // or
  // this.$$('login-fire-form').signOut();
}

Debugging

To make it easier to debug, we've added the debug attribute. Set the "debug" attribute of the element to true to see more details about its variables' values.

Example:

<login-fire-form app-name="email" debug></login-fire-form>

Styling

Style the buttons with CSS as you would a normal DOM element. A few custom properties and mixins are available. The detailed lists are on each element's documentation page.

Contributing

Install the Polymer-CLI

First, make sure you have the Polymer CLI installed. Then run polymer serve to serve your application locally.

Viewing Your Application

$ polymer serve

Building Your Application

$ polymer build

This will create a build/ folder with bundled/ and unbundled/ sub-folders containing a bundled (Vulcanized) and unbundled builds, both run through HTML, CSS, and JS optimizers.

You can serve the built versions by giving polymer serve a folder to serve from:

$ polymer serve build/bundled

Running Tests

$ polymer test

Your application is already set up to be tested via web-component-tester. Run polymer test to run your application's test suite locally.

Workflow

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -m 'Add some feature'

Optional but highly encouraged: Follow this commit guide

  1. Push to the branch: git push origin my-new-feature
  2. Submit a pull request. :D

License

MIT

Credits

Logo: Fingerprint by Gregor Cresnar from the Noun Project

Browser Testing

BrowserStack

Thanks to the support of BrowserStack we can do real cross browser testing on multiple desktop and mobile platforms.

login-fire's People

Contributors

sbeleidy avatar masonlouchart avatar bkawk avatar protoss78 avatar oupsla avatar polinom avatar jaysunsyn avatar gitter-badger avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.