change user endpoint to calandar

This commit is contained in:
2026-08-06 20:25:44 -04:00
parent a0c57bd582
commit ec901d97c2
3 changed files with 3 additions and 4 deletions
+1 -2
View File
@@ -44,10 +44,9 @@ func OAuthCallback(w http.ResponseWriter, r *http.Request) {
return
}
// Store the token securely
if err := TestTokenStore.Save(token); err != nil {
log.Printf("Failed to save token: %v", err)
}
http.Redirect(w, r, "/user", http.StatusTemporaryRedirect)
http.Redirect(w, r, "/calandar", http.StatusTemporaryRedirect)
}
+1 -1
View File
@@ -9,7 +9,7 @@ import (
"astraltech.xyz/calendar/v2/auth"
)
func handleUser(w http.ResponseWriter, r *http.Request) {
func HandleCalandarEndpoint(w http.ResponseWriter, r *http.Request) {
token, err := auth.TestTokenStore.Load()
if err != nil {
http.Error(w, "Not authenticated", http.StatusUnauthorized)
+1 -1
View File
@@ -21,7 +21,7 @@ func main() {
AuthRequestFunction: auth.HandleAuthRequest,
})
webserver.ServeWebpage("/callback", auth.OAuthCallback)
webserver.ServeWebpage("/user", handleUser)
webserver.ServeWebpage("/calandar", HandleCalandarEndpoint)
webserver.EnableLogoRoute()
webserver.EnableStaticRoute()