diff --git a/auth.go b/auth.go
new file mode 100644
index 0000000..75022c6
--- /dev/null
+++ b/auth.go
@@ -0,0 +1,118 @@
+package main
+
+import (
+ "fmt"
+ "math/rand"
+ "net/http"
+ "strings"
+ "time"
+
+ "github.com/gorilla/mux"
+)
+
+func reqPass(w http.ResponseWriter, r *http.Request) {
+ username := r.FormValue("UserName")
+ ipaddr := r.Header.Get("X-Real-IP")
+ log.LogInfo(fmt.Sprintf("reqPass called:```username: %s\nip : %s```", username, ipaddr))
+ sendPassword(username, ipaddr)
+ http.Redirect(w, r, "/login", 302)
+}
+
+func tryLogin(w http.ResponseWriter, r *http.Request) {
+ session, err := store.Get(r, "2fa")
+ if err != nil {
+ log.LogWarn("Error opening session for 2fa store")
+ }
+ vars := mux.Vars(r)
+ username := vars["username"]
+ password := vars["password"]
+ ip := r.Header.Get("X-Real-IP")
+ if len(username) == 0 {
+ username = r.FormValue("UserName")
+ password = r.FormValue("TempPass")
+ }
+ access, _ := detectUser(r, "tryLogin")
+ if !access {
+ log.LogDebug(fmt.Sprintf("%s is attempting login", getSessionIdentifier(r)))
+ access = usePassword(username, password, ip)
+ if access {
+ log.LogInfo(fmt.Sprintf("%s has successfully logged in from %s", username, ip))
+ log.LogDebug(fmt.Sprintf("```%+v```", session.Values))
+ session.Values["username"] = username
+ session.Values["ip"] = ip
+ session.Values["timestamp"] = fmt.Sprintf("%+v", time.Now())
+ err = session.Save(r, w)
+ if err != nil {
+ log.LogWarn(fmt.Sprintf("Error saving cookie. ```%+v```", err))
+ }
+ }
+ }
+
+ fmt.Fprintf(w, "
Login Success: %+v
$CONTENT
+$FOOTER
+What website doesn't use cookies nowadays?
+This website does not use any 3rd party cookies. All cookies are encrypted and only used by this website.
+If you are actually reading this, chances are your data isn't valuable enough for me to care about tracking you.
+Click the "Submit" button and a temporary password will be sent to the Discord User.
+