Socket
Socket
Sign inDemoInstall

@8base/web-oauth-client

Package Overview
Dependencies
Maintainers
5
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@8base/web-oauth-client

The 8base web oauth client for the `AuthProvider`.


Version published
Weekly downloads
411
decreased by-4.86%
Maintainers
5
Weekly downloads
 
Created
Source

8base api token auth client

The 8base web oauth client for the AuthProvider.

WebOAuthClient

Table of Contents
  • WebOAuthClient

WebOAuthClient

Create instance of the web oauth client

Parameters
  • authorize Function Function used to describe authorize logic.

Usage

Firebase oauth

import firebase from 'firebase';
import { WebOAuthClient } from '@8base/web-oauth-client';

const FIREBASE_CONFIGURATION = {
  apiKey: "",
  authDomain: "",
  databaseURL: "",
  projectId: "",
  storageBucket: "",
  messagingSenderId: "",
  appId: ""
};

const firebaseAuth = firebase.initializeApp(FIREBASE_CONFIGURATION).auth();

const authClient = new WebOAuthClient({
  authorize (email, password) {
    return firebaseAuth.signInWithEmailAndPassword(
      email,
      password,
    )
      .then(() => firebaseAuth.currentUser.getIdToken())
      .then((token) => {
        return token;
      })
    },
  logout() {
    window.addEventListener('unload', () => {
      this.purgeState();
    });

    window.location.href = '/';
  }
});

Examples

Firebase oauth example
IBM cloud oauth example

FAQs

Package last updated on 16 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc