Log the User In with GitHub

This action logs the user in with authentication from a GitHub account.


Firebase Console Configuration

Go to the Firebase Console of you project, and them to the Authentication service. On it, you must select the tab "Sign-in method".

Link: https://console.firebase.google.com/u/0/project/YOUR_PROJECT_ID/authentication/providers.

If you click on "Add a new provider", will be able to choose from various authentication methods.

Right now, the plugin supports only Email/Password, Google, Facebook and Github methods.

When you select the GitHub method, you'll have to fill the Client ID and Client Secret fields. They can be obtained from the Developer Settings on Github. You'll need to create a new app and, in it, generate a new Client Secret. You'll also need to allow for the callback URL provided by Firebase (the one ending with "__/auth/handler") on your Github app "General" settings.

After filling the info and clicking "Save", you can test the login and check if all settings on Github are working properly.


Inputs and Settings

Trigger ID (optional)

This will link the action with a Action Listener of the same ID.

If left blank, all listener on the page with blank ID's will be triggered at the same time, so we suggest to always define a Trigger ID.

When the function finishes running, it will trigger the User Signed Up event, storing the New User ID and New User Email on the listener's states.

Copy profile data into firestore collection

If you check this option, the user's profile data will be stored not only on the user, from the Firebase Authentication service, but also on the user's document.

If is recommended to left it checked, since it gives more flexibility while accessing this information, as well as utilizing it on queries and filters for users.

Other User Data

Users Collection

The name or ID of the collection where user's should be stored in. A document will be created with the same ID of the newly created user account.

Fields

Since a new document is being created, you can store data in it the same way it is done to any new document.

When you create a document on Firestore, you must inform which fields and which content each will have on it's structure, in JSON format. This input allows you to set as many fields as you want.

For each field you must specify the "key" and the "value" that will be stored. For instance, you might want to store a "status" for the new user, of "active", to control access to your app. You'd need to define the "key" = "status" and the "value" = "active".

Field Types

For each key/value pair you define and provide a value on the Fields list, you must provide the same key, but with the type of the value, on the Field Types input. That allows the plugin to turn the texts being fed into the plugin into corresponding values on the JSON structure sent to Firestore.

If the number of Fields and Field Types don't match, the action will result in an error.

See the field types table to see which types are currently supported by the plugin and how to define them.


Triggered events

Those events are triggered by an Action Listener with the same ID as the Trigger ID provided on the action.

  • User Signed Up (if the action was successful and it's the first time the user logged in)

  • User Logged In (if the action was successful and it's not the first time the user logged in)

  • Error in Action (if an error occurs)


Stored values on the listener

User ID

The ID of the user and document created by the action.

User Email

The email of the user account created by the action.

Error Message

If an error occurs, you can check its details on this state on the action listener.

Last updated