Trim and anonymize idempotency key
This commit is contained in:
parent
e6d71710e5
commit
d491f129c0
|
|
@ -1,5 +1,6 @@
|
||||||
// deno-lint-ignore-file ban-ts-comment
|
// deno-lint-ignore-file ban-ts-comment
|
||||||
import "jsr:@std/dotenv/load";
|
import "jsr:@std/dotenv/load";
|
||||||
|
import { encodeHex } from "jsr:@std/encoding/hex";
|
||||||
import { getHostUrl } from "../utils.ts";
|
import { getHostUrl } from "../utils.ts";
|
||||||
import { STATUS_CODE } from "$fresh/server.ts";
|
import { STATUS_CODE } from "$fresh/server.ts";
|
||||||
|
|
||||||
|
|
@ -50,7 +51,8 @@ export const createAgreement = async function (email: string) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
headers: {
|
headers: {
|
||||||
authorization: `Bearer ${token}`,
|
authorization: `Bearer ${token}`,
|
||||||
"Idempotency-Key": `${email}-${Date.now()}`,
|
// anonymized and trimmed to not be too long (then it fails)
|
||||||
|
"Idempotency-Key": `${encodeHex(email).slice(0, 10)}-${Date.now()}`,
|
||||||
...standardVippsHeaders,
|
...standardVippsHeaders,
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
# Bugs
|
||||||
|
- [ ] enter on sponsor input reloads the page
|
||||||
|
- [ ] reproduce
|
||||||
|
- [ ] fix
|
||||||
|
- [ ] report back to user (MFA email)
|
||||||
|
- [ ] user (MFA email) gets an error with one of his emails (see mail thread)
|
||||||
|
- [x] reproduce
|
||||||
|
- [x] fix
|
||||||
|
- [ ] report back to user
|
||||||
|
- [ ] there are more users registered as paying users than there are payments received
|
||||||
|
- [ ] are these people supposed to still be subscribers?
|
||||||
|
- [ ] how can this have happenned?
|
||||||
Loading…
Reference in New Issue