change user endpoint to calandar
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user