This file contains 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
constructor(private angularFireFunctions: AngularFireFunctions) { | |
if (!environment.production) { | |
this.angularFireFunctions.functions.useFunctionsEmulator('http://localhost:5000');// Your emulator or serve URL | |
} | |
} |
This file contains 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 { NgModule } from '@angular/core'; | |
import { Routes, RouterModule } from '@angular/router'; | |
import { PasswordLessLoginComponent } from './login/password-less-login/password-less-login.component'; | |
import { SendEmailComponent } from './email/send-email/send-email.component'; | |
import { AngularFireAuthGuard, redirectLoggedInTo, redirectUnauthorizedTo } from '@angular/fire/auth-guard'; | |
const redirectUnauthorizedToLogin = () => redirectUnauthorizedTo(['login']); | |
const redirectLoggedInToSendEmail = () => redirectLoggedInTo(['send-email']); | |
const routes: Routes = [{ |
This file contains 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
async sendEmail(email: string) { | |
const actionCodeSettings = { | |
// URL you want to redirect back to. The domain (www.example.com) for this | |
// URL must be whitelisted in the Firebase Console. | |
url: environment.redirectURL, | |
// This must be true. | |
handleCodeInApp: true | |
}; | |
try { |
This file contains 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
// Firebase Config | |
import * as functions from 'firebase-functions'; | |
// Sendgrid Config | |
import * as sgMail from '@sendgrid/mail'; | |
import { onlyAlpha, emailPattern } from './constants/constants'; | |
const API_KEY = functions.config().sendgrid.key; | |
const templateId = functions.config().sendgrid.template; | |
const from = functions.config().sendgrid.from; |