Created
October 29, 2018 08:01
-
-
Save katsu-o/3c093cf8a2bcc43add6a69e96cb88319 to your computer and use it in GitHub Desktop.
Firebase Authentication + SPA(React/TypeScript) でサンプル作り直してみた ref: https://qiita.com/katsu-o/items/728812f5d7f682e80fc3
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
... | |
// 追加利用する認証プロバイダ | |
// Email & Password および Google は組み込み | |
// Facebook, Twitter, GitHub の追加選択設定(使わない場合は空配列) | |
export const AUTH_AVAILABLE_PROVIDERS = ['Facebook', 'Twitter', 'GitHub']; | |
// Firebase Authentication 更新系処理後に行う認証情報再取得待ち時間(ms) | |
export const AUTH_RELOAD_TIMEOUT = 2000; | |
// Email Verify の是非 | |
export const AUTH_EMAIL_VERIFICATION_REQUIRED = false; | |
// @gmail.com への アカウント Email 変更時 Email Verify メール送信の是非 | |
export const AUTH_SEND_EMAIL_VERIFICATION_AT_EMAIL_UPDATED = false; | |
// パスワードリセットメール送信時の user not found メッセージ表示の是非 | |
export const AUTH_SHOW_USER_NOT_FOUND_AT_SEND_PASSWORD_RESET_EMAIL = true; |
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
# 1. GitHub からクローン | |
$ git clone [email protected]:katsu-o/firebase-auth-spa.git | |
$ cd firebase-auth-spa | |
# 2. 依存パッケージのインストール | |
$ yarn install | |
# 3. .env ファイルを作成 | |
$ mv .env.sample .env | |
# 4. .env ファイルの中身を埋める | |
# Firebase コンソールの Authentication にある「ウェブ設定」をクリックすると表示される | |
# config を当該箇所にセットして下さい。 | |
# .env ファイルへの設定文字列にクォートは不要です。=の後に余計な空白もつけないでください。 | |
# 5. Firebase へログイン | |
$ firebase login | |
# 6. Firebase プロジェクトの選択 | |
$ firebase use --add | |
# 7. サンプル起動 | |
$ yarn start | |
以上です。 | |
Hosting URL へアクセスして下さい。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment