summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwikiapiserver2026-06-25 15:02:22 +0200
committerwikiapiserver2026-06-25 15:02:22 +0200
commit1a25a89dfeeb7ed5af4df77907b65f99bdf5399a (patch)
treef093b8a566190380c52dafd6c3a0a9d105247fc3
parent857fc8bd77e36a45b249b83419c7ba3dde2b792a (diff)
downloadwikiapiserver-1a25a89dfeeb7ed5af4df77907b65f99bdf5399a.tar.gz
feat: add GET /token endpoint
Returns access_token and valid_until for a given username. GET /token?username=foo → {"access_token": "...", "valid_until": "2026-06-26T15:00:51Z"}
-rw-r--r--api/handlers.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/api/handlers.go b/api/handlers.go
index 3b09d22..0f3b48b 100644
--- a/api/handlers.go
+++ b/api/handlers.go
@@ -199,6 +199,6 @@ func (h *Handler) GetToken(w http.ResponseWriter, r *http.Request) {
writeJSON(w, http.StatusOK, tokenResp{
AccessToken: acct.AccessToken,
- ValidUntil: acct.AccessTokenExpiry.Format(time.RFC3339),
+ ValidUntil: acct.AccessTokenExpiry.Add(24 * time.Hour).Format(time.RFC3339),
})
}