Skip to content

Instantly share code, notes, and snippets.

@austin43
austin43 / gist:c36a757890747a3222b4137edadf211f
Created December 21, 2020 20:35
firebase jwt local vs cloud
//local jwt
{
"alg": "none",
"typ": "JWT"
}
{
"name": "Grass Orange",
"https://hasura.io/jwt/claims": {
"x-hasura-default-role": "user",
@austin43
austin43 / Example.tsx
Created March 24, 2020 23:27
Ionic Segments and Slides
import React, { useRef } from "react";
import "./Example.css";
import {
IonSegment,
IonSegmentButton,
IonSlides,
IonSlide
} from "@ionic/react";
interface ContainerProps {
@austin43
austin43 / config.ts
Created February 26, 2020 22:32
ts-auto-mock configs
import 'jest-ts-auto-mock'
@austin43
austin43 / ApolloProvider.tsx
Created January 2, 2020 03:20
Apollo Hasura Firebase
const authLink = setContext(async () => {
const idToken = await user.getIdToken()
const headers = { Authorization: `Bearer ${idToken}` }
return {
headers,
}
})
const httpLink = new HttpLink({
uri: process.env.REACT_APP_GRAPHQL_HTTP_URL || '',
@austin43
austin43 / firebaseSignIn.ts
Last active February 2, 2020 14:31
Pulumi CORS
const getHeaders = async () => {
const token = await getToken()
return {
Authorization: `Bearer ${token}`,
'x-api-key': process.env.REACT_APP_FIREBASE_AUTH_API_KEY,
}
}
const headers = await getHeaders()