This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var sessionManager = scs.NewCookieManager("...") | |
| func RequireLogin(next http.Handler) http.Handler { | |
| return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | |
| session := sessionManager.Load(r) | |
| userID, err := session.GetInt("userID") | |
| if err != nil { | |
| http.Error(w, err.Error(), http.StatusInternalServerError) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| You'll need to pip install some dependencies: | |
| * python-dateutil | |
| * requests | |
| Also, populate your EMAIL and PASSWORD below. | |
| ''' | |
| from xml.etree import ElementTree |
OlderNewer