Skip to content

Instantly share code, notes, and snippets.

@nurmdrafi
Last active April 30, 2022 14:36
Show Gist options
  • Save nurmdrafi/332edbde218343746b045c217f23241a to your computer and use it in GitHub Desktop.
Save nurmdrafi/332edbde218343746b045c217f23241a to your computer and use it in GitHub Desktop.
1. Basic Installation
> Install required modules
> Delete unnecessary files
> Create components
> Setup routes
> Custom active link
2. Firebase
i) Initialize firebase
> firebase.init.js
> evn variable setup
ii) Implement authentication
> createUserWithEmailAndPassword (Create new account and instant Sign In)
/> form validation
/> error handling (Show error)
/> if(loading) return < Loading />
/> Toast(Authentication error/success)
/> UpdateProfile [Optional]
/> JWT
> useAuthState (Current user)
/> Conditional rendering | if(user)
> signOut(auth)
> signInWithEmailAndPassword (Sign In with existing account)
/> form validation
/> error handling (Show error)
/> if(loading) return < Loading />
/> Toast(Authentication error/success)
/> forgetPassword
/> SendEmailVerification [Recommanded]
/> UpdateEmail [Optional]
/> UpdatePassword [Optional]
/> JWT
> useSignInWithXXX(Google, Facebook, Github, Apple, Twitter)
/> JWT
3. RequireAuth
> set navigation / useEffect(() => {}, [])
/> if(loading) return < Loading />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment