New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@8base/web-oauth-client

Package Overview
Dependencies
Maintainers
6
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`.

3.0.0-beta.0
Source
npm
Version published
Maintainers
6
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 22 Jun 2022

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