나는 여러가지 기능 중에 Authentication를 이용하여 로그인, 회원가입을 구현할 수 있었다.
import { emailRegex, pwRegex } from "../util.js";
import { authService } from "../firebase.js";
import {
createUserWithEmailAndPassword,
signInWithEmailAndPassword,
GoogleAuthProvider,
signInWithPopup,
GithubAuthProvider,
signOut,
} from "https://www.gstatic.com/firebasejs/9.14.0/firebase-auth.js";
또한 Cloud Firestore, Storage를 통해서 게시판 기능을 구현할 수 있었고, 프로필의 이미지를 저장하고 변경하는 기능도 구현할 수 있게 되었다.
import { authService, storageService } from "../firebase.js";
import {
ref,
uploadString,
getDownloadURL,
} from "https://www.gstatic.com/firebasejs/9.14.0/firebase-storage.js";
import { updateProfile } from "https://www.gstatic.com/firebasejs/9.14.0/firebase-auth.js";
import { v4 as uuidv4 } from "https://jspm.dev/uuid";
import {
doc,
addDoc,
updateDoc,
deleteDoc,
collection,
orderBy,
query,
getDocs,
} from "https://www.gstatic.com/firebasejs/9.14.0/firebase-firestore.js";
import { dbService, authService } from "../firebase.js";