projects
/
kraftakt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Implement Fitbit and Google Fit disconnect handlers.
[kraftakt.git]
/
kraftakt.go
diff --git
a/kraftakt.go
b/kraftakt.go
index
b49f787
..
1f3ac98
100644
(file)
--- a/
kraftakt.go
+++ b/
kraftakt.go
@@
-22,11
+22,13
@@
import (
var delayedHandleNotifications = delay.Func("handleNotifications", handleNotifications)
func init() {
var delayedHandleNotifications = delay.Func("handleNotifications", handleNotifications)
func init() {
- http.Handle
Func("/fitbit/setup", fitbitSetupHandler
)
+ http.Handle
("/fitbit/connect", AuthenticatedHandler(fitbitConnectHandler)
)
http.Handle("/fitbit/grant", AuthenticatedHandler(fitbitGrantHandler))
http.Handle("/fitbit/notify", ContextHandler(fitbitNotifyHandler))
http.Handle("/fitbit/grant", AuthenticatedHandler(fitbitGrantHandler))
http.Handle("/fitbit/notify", ContextHandler(fitbitNotifyHandler))
- http.HandleFunc("/google/setup", googleSetupHandler)
+ http.Handle("/fitbit/disconnect", AuthenticatedHandler(fitbitDisconnectHandler))
+ http.Handle("/google/connect", AuthenticatedHandler(googleConnectHandler))
http.Handle("/google/grant", AuthenticatedHandler(googleGrantHandler))
http.Handle("/google/grant", AuthenticatedHandler(googleGrantHandler))
+ http.Handle("/google/disconnect", AuthenticatedHandler(googleDisconnectHandler))
http.Handle("/", AuthenticatedHandler(indexHandler))
}
http.Handle("/", AuthenticatedHandler(indexHandler))
}
@@
-123,8
+125,9
@@
func indexHandler(ctx context.Context, w http.ResponseWriter, r *http.Request, u
return nil
}
return nil
}
-func fitbit
SetupHandler(w http.ResponseWriter, r *http.Request)
{
+func fitbit
ConnectHandler(_ context.Context, w http.ResponseWriter, r *http.Request, _ *app.User) error
{
http.Redirect(w, r, fitbit.AuthURL(), http.StatusTemporaryRedirect)
http.Redirect(w, r, fitbit.AuthURL(), http.StatusTemporaryRedirect)
+ return nil
}
func fitbitGrantHandler(ctx context.Context, w http.ResponseWriter, r *http.Request, u *app.User) error {
}
func fitbitGrantHandler(ctx context.Context, w http.ResponseWriter, r *http.Request, u *app.User) error {