This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func GetRSAPublicKey() (*rsa.PublicKey, error) { | |
keyData, err := ioutil.ReadFile("id_rsa.pub.pkcs8") | |
if err != nil { | |
return nil, err | |
} | |
return jwt.ParseRSAPublicKeyFromPEM(keyData) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import Avatar from '@material-ui/core/Avatar'; | |
import Button from '@material-ui/core/Button'; | |
import CssBaseline from '@material-ui/core/CssBaseline'; | |
import TextField from '@material-ui/core/TextField'; | |
import Link from '@material-ui/core/Link'; | |
import Grid from '@material-ui/core/Grid'; | |
import Box from '@material-ui/core/Box'; | |
import LockOutlinedIcon from '@material-ui/icons/LockOutlined'; | |
import Typography from '@material-ui/core/Typography'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import './App.css'; | |
import SignUp from './SignUp'; | |
const App: React.FC = () => { | |
return ( | |
<SignUp /> | |
); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REACT_APP_FIREBASE_APIKEY=xxxx // apiKey | |
REACT_APP_FIREBASE_AUTHDOMAIN=xxxx // authDomain | |
REACT_APP_FIREBASE_DATABASEURL=xxxx // databaseURL | |
REACT_APP_FIREBASE_PROJECTID=xxxx // projectId | |
REACT_APP_FIREBASE_STORAGEBUCKET=xxxx // storageBucket | |
REACT_APP_FIREBASE_MESSAGINGSENDERID=xxxx // messagingSenderId | |
REACT_APP_FIREBASE_APPID=xxxx // appId | |
REACT_APP_FIREBASE_MEASUREMENTID=xxxx // measurementId |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as firebase from 'firebase/app' | |
import 'firebase/auth' | |
import { | |
FIREBASE_APIKEY, | |
FIREBASE_APPID, | |
FIREBASE_AUTHDOMAIN, | |
FIREBASE_DATABASEURL, | |
FIREBASE_MEASUREMENTID, | |
FIREBASE_MESSAGINGSENDERID, | |
FIREBASE_PROJECTID, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const FIREBASE_APIKEY = process.env.REACT_APP_FIREBASE_APIKEY | |
export const FIREBASE_AUTHDOMAIN = process.env.REACT_APP_FIREBASE_AUTHDOMAIN | |
export const FIREBASE_DATABASEURL = process.env.REACT_APP_FIREBASE_DATABASEURL | |
export const FIREBASE_PROJECTID = process.env.REACT_APP_FIREBASE_PROJECTID | |
export const FIREBASE_STORAGEBUCKET = process.env.REACT_APP_FIREBASE_STORAGEBUCKET | |
export const FIREBASE_MESSAGINGSENDERID = | |
process.env.REACT_APP_FIREBASE_MESSAGINGSENDERID | |
export const FIREBASE_APPID = process.env.REACT_APP_FIREBASE_APPID | |
export const FIREBASE_MEASUREMENTID = process.env.REACT_APP_FIREBASE_MEASUREMENTID |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
type State = { | |
email: string | |
password: string | |
} | |
const initialState = { | |
email: '', | |
password: '', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
const SignUp: React.FC = () => { | |
// ... | |
useEffect(() => { | |
firebase.auth().onAuthStateChanged(user => { | |
if (user) { | |
// user signed in | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
mysql: | |
image: mysql:8.0 | |
volumes: | |
- mysqldata:/var/lib/mysql | |
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_0900_as_ci --default-authentication-plugin=mysql_native_password | |
environment: | |
MYSQL_USER: root | |
MYSQL_ROOT_PASSWORD: root |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- +goose Up | |
-- +goose StatementBegin | |
CREATE TABLE users ( | |
id INT NOT NULL AUTO_INCREMENT, | |
uuid varchar(255) NOT NULL, | |
email varchar(255) DEFAULT NULL, | |
created_at datetime DEFAULT NULL, | |
updated_at datetime DEFAULT NULL, | |
deleted_at timestamp NULL DEFAULT NULL, | |
INDEX user_id (id), |