properly set expires in storage

This commit is contained in:
Tim Möhlmann 2023-02-24 10:18:31 +01:00
parent 768a1355d9
commit 0f9ec46aaa
3 changed files with 10 additions and 5 deletions

View file

@ -77,7 +77,9 @@ func DeviceAuthorization(w http.ResponseWriter, r *http.Request, o OpenIDProvide
RequestError(w, r, err)
return
}
err = storage.StoreDeviceAuthorization(r.Context(), req.ClientID, deviceCode, userCode, req.Scopes)
expires := time.Now().Add(time.Duration(config.Lifetime) * time.Second)
err = storage.StoreDeviceAuthorization(r.Context(), req.ClientID, deviceCode, userCode, expires, req.Scopes)
if err != nil {
RequestError(w, r, err)
return