All Projects β†’ epilande β†’ gatsby-theme-auth0

epilande / gatsby-theme-auth0

Licence: MIT license
πŸ” A Gatsby Theme for adding Auth0 to your application.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to gatsby-theme-auth0

Golang Gin
Build a Golang app with the Gin framework, and authenticate with Auth0 + JWT
Stars: ✭ 160 (+255.56%)
Mutual labels:  auth0
Auth0 Angular Samples
Auth0 Integration Samples for Angular 2+ Applications
Stars: ✭ 227 (+404.44%)
Mutual labels:  auth0
restish
Restish is a CLI for interacting with REST-ish HTTP APIs with some nice features built-in
Stars: ✭ 453 (+906.67%)
Mutual labels:  auth0
Prisma Auth0 Example
Boilerplate Prisma Startup
Stars: ✭ 184 (+308.89%)
Mutual labels:  auth0
Lock.swift
A Swift & iOS framework to authenticate using Auth0 and with a Native Look & Feel
Stars: ✭ 215 (+377.78%)
Mutual labels:  auth0
Terraform Provider Auth0
Auth0 Terraform Provider
Stars: ✭ 252 (+460%)
Mutual labels:  auth0
Auth0.swift
Swift toolkit for Auth0 API
Stars: ✭ 146 (+224.44%)
Mutual labels:  auth0
gatsby-theme-terminal
A Gatsby theme for techies who love terminal / command line / bash like portfolio.
Stars: ✭ 20 (-55.56%)
Mutual labels:  gatsby-theme
Actingweb firstapp
Starter app for Flutter that includes many different production app features; some not typically included in demo apps.
Stars: ✭ 224 (+397.78%)
Mutual labels:  auth0
django-mail-auth
Django authentication via login URLs, no passwords required
Stars: ✭ 48 (+6.67%)
Mutual labels:  auth0
Starter Pack
Combines React (ft. hooks), Redux, Redux-saga and TypeScript with Auth0 as a starting point for modern web apps with solid authentication
Stars: ✭ 209 (+364.44%)
Mutual labels:  auth0
Useauth
The simplest way to add authentication to your React app. Supports various providers.
Stars: ✭ 2,532 (+5526.67%)
Mutual labels:  auth0
auth0-cli
Build, manage and test your Auth0 integrations from the command line
Stars: ✭ 186 (+313.33%)
Mutual labels:  auth0
Supertokens Core
Open source alternative to Auth0 / Firebase Auth / AWS Cognito
Stars: ✭ 2,907 (+6360%)
Mutual labels:  auth0
numvalidate
Phone number validation REST API
Stars: ✭ 54 (+20%)
Mutual labels:  auth0
Cfworker
A collection of packages optimized for Cloudflare Workers and service workers.
Stars: ✭ 152 (+237.78%)
Mutual labels:  auth0
Authing
πŸ”₯Authing - IDaaS/IAM solution that can Auth to web and mobile applications.
Stars: ✭ 247 (+448.89%)
Mutual labels:  auth0
auth0-laravel-api-samples
Auth0 Integration Samples for Laravel REST API Services
Stars: ✭ 18 (-60%)
Mutual labels:  auth0
react-auth-hook
A small library for authenticating users in React using Auth0.
Stars: ✭ 20 (-55.56%)
Mutual labels:  auth0
auth0-golang-web-app
Auth0 Integration Samples for Go Web Applications
Stars: ✭ 112 (+148.89%)
Mutual labels:  auth0

gatsby-theme-auth0 πŸ”

A Gatsby theme for adding Auth0 to your application.

GitHub npm Netlify Status

What's in the box?

Installation

$ npm install --save gatsby-theme-auth0

Usage

// gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: "gatsby-theme-auth0",
      options: {
        domain: process.env.AUTH0_DOMAIN,
        clientID: process.env.AUTH0_CLIENT_ID,
        redirectUri: process.env.AUTH0_CALLBACK_URL,
        // audience: process.env.AUTH0_AUDIENCE, // Optional
        // responseType: process.env.AUTH0_RESPONSE_TYPE, // Optional
        // scope: process.env.AUTH0_SCOPE, // Optional
        // callbackPath: "/auth/callback", // Optional
      },
    },
  ],
};

Set up your login/logout buttons and you're good to go!

import React from "react";
import { AuthService, useAuth } from "gatsby-theme-auth0";

export default () => {
  const { isLoggedIn, profile } = useAuth();
  return (
    <div>
      {profile && <p>Hello {profile.name}</p>}
      {isLoggedIn ? (
        <button onClick={AuthService.logout}>Logout</button>
      ) : (
        <button onClick={AuthService.login}>Login</button>
      )}
    </div>
  );
};

Theme options

Key Default Required Description
domain true Configure Auth0 Domain
clientID true Configure Auth0 Client ID
redirectUri true Configure Auth0 Callback URL
audience false Configure Auth0 Audience
responseType "token id_token" false Configure Auth0 Response Type
scope "openid email profile" false Configure Auth0 Scope
callbackPath "/auth/callback" false Change callback URL path

Shadowing

Gatsby Themes has a concept called Shadowing, which allows users to override a file in a gatsby theme. This allows the theme to be fully customizable.

To start shadowing, create a folder with the theme name gatsby-theme-auth0 in your project's src directory.

Now you're able to override any file in the theme. For example, if you want to override the callback component, create a file:

src/gatsby-theme-auth0/components/callback.js

Here's a demo of that demos/custom/src/gatsby-theme-auth0/components/callback.js

Demos

Dev

Set up env variables

Go to demo application directory, copy the .env.example -> .env.development. Fill in the required environment variables before starting up the client dev server.

Available Scripts

$ yarn dev

This will run the demo app in development mode using .env.development.

Navigate to http://localhost:8000 to view it in the browser.

$ yarn build

This will build the demo app for production using .env.production.

Outputs to the demo/public folder.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].