Skip to content

Instantly share code, notes, and snippets.

@muhammadqazi
Last active February 6, 2022 10:37
Show Gist options
  • Save muhammadqazi/d010d73875d27099cbdc5610b3698c44 to your computer and use it in GitHub Desktop.
Save muhammadqazi/d010d73875d27099cbdc5610b3698c44 to your computer and use it in GitHub Desktop.
Go-Authentication
package main
import (
"net/http"
EmailVerification "GO/routes/Auth/EmailVerification"
ForgotPass "GO/routes/Auth/ForgotPass"
GoogleAuth "GO/routes/Auth/GoogleAuthenticator"
Signin "GO/routes/Auth/Signin"
Signup "GO/routes/Auth/Signup"
)
func main() {
http.HandleFunc("/signup", Signup.HandleSignup)
http.HandleFunc("/signin", Signin.HandleSignin)
http.HandleFunc("/emailVerify", EmailVerification.HandleEmailVerification)
http.HandleFunc("/forgotPass", ForgotPass.HandleForgotPass)
http.HandleFunc("/codeAuth", ForgotPass.HandleCodeAuth)
http.HandleFunc("/newPass", ForgotPass.HandleNewPassword)
http.HandleFunc("/googleAuth", GoogleAuth.HandleGoogleAuthenticate)
http.HandleFunc("/googleAuthCode", GoogleAuth.HandleCodeAuth)
http.ListenAndServe(":8080", nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment