commit e8859f06eef50bb461028e110b62c2698a3336f5
parent 8eaf5e0ef75f9ccf69c65baddbe05cfc14c6c3d1
Author: MTRNord <mtrnord1@gmail.com>
Date: Thu, 28 Jun 2018 21:24:53 +0200
Handle auth differently
Diffstat:
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/.idea/usage.statistics.xml b/.idea/usage.statistics.xml
@@ -38,14 +38,14 @@
<session id="958628364">
<usages-collector id="statistics.file.extensions.edit">
<counts>
- <entry key="go" value="402" />
- <entry key="txt" value="245" />
+ <entry key="go" value="436" />
+ <entry key="txt" value="273" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.types.edit">
<counts>
- <entry key="Go" value="402" />
- <entry key="PLAIN_TEXT" value="245" />
+ <entry key="Go" value="436" />
+ <entry key="PLAIN_TEXT" value="273" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.extensions.open">
diff --git a/pkg/webhook/webhook.go b/pkg/webhook/webhook.go
@@ -109,6 +109,18 @@ func MessagesEndPoint(rw http.ResponseWriter, req *http.Request) {
rw.Header().Set("Content-Type", "application/json")
rw.WriteHeader(http.StatusOK)
json.NewEncoder(rw).Encode(dff)
+ case "auth":
+ log.Println(dfr.QueryResult)
+
+ dff := &df.Fulfillment{
+ FulfillmentMessages: df.Messages{
+ df.ForGoogle(df.SingleSimpleResponse("Authentication finished", "Authentication finished")),
+ {RichMessage: df.Text{Text: []string{"Authentication finished"}}},
+ },
+ }
+ rw.Header().Set("Content-Type", "application/json")
+ rw.WriteHeader(http.StatusOK)
+ json.NewEncoder(rw).Encode(dff)
default:
log.Println(dfr.QueryResult.Parameters)