Skip to content

Instantly share code, notes, and snippets.

View miikkaa's full-sized avatar

Misha K. miikkaa

View GitHub Profile
@pixelastic
pixelastic / custom-token.js
Created July 2, 2018 10:44
Firebase function to return an Auth0 custom token
import cors from 'cors';
import Promise from 'bluebird';
import axios from 'axios';
import database from '../database/database.js';
/**
* The goal of this function is to mint custom token that can be used to
* authenticate to Firebase.
* The function will be called through https, and will check the credentials of
* the requested user (through the usage of its Auth0 token). If the Auth0 token