Example #1
0
func updateHandle(w http.ResponseWriter, r *http.Request, s *session.Session) {
	// Probs implement TOTP, potentially vulnerable to MTM
	if s.VerifiedUpdate(r.URL.Query()["hash"][0]) {
		s.SetHashtags(strings.Split(r.URL.Query()["hashtags"][0], " "))
		s.ParseTheta(strings.Split(r.URL.Query()["theta"][0], " "))
		s.SetLearnt()
		fmt.Fprint(w, "Updated")
	} else {
		fmt.Fprint(w, "Not Verified")
	}
}
Example #2
0
func authHandle(w http.ResponseWriter, r *http.Request, s *session.Session) {
	s.SetHashtags(strings.Split(r.URL.Query()["hashtags"][0], " "))
	action.Authenticate(s, r.URL.Query()["code"][0])

	http.Redirect(w, r, "/", 302)
}