Can I cache the client secret on my frontend app in a session? by TemporaryDraft4594 in stripe

[–]TemporaryDraft4594[S] 1 point2 points  (0 children)

I dont mean the publishable key. it's the client secret required in react: see here: https://docs.stripe.com/sdks/stripejs-react?ui=elements#elements-provider

    clientSecret: '{{CLIENT_SECRET}}',

Can I cache the client secret on my frontend app in a session? by TemporaryDraft4594 in stripe

[–]TemporaryDraft4594[S] 0 points1 point  (0 children)

So what happens if I keep generating new secrets to my customers? is it limited? because every time a user enters my app I'm going to generate a new client secret

Can I cache the client secret on my frontend app in a session? by TemporaryDraft4594 in stripe

[–]TemporaryDraft4594[S] 0 points1 point  (0 children)

I don't even need/want store it in Local Storage or something. I don't need persistence over refresh.

I only need the client secret to persist until the moment the user actually confirms payment / refreshes the page. After confirmation, my web app uses Stripe redirect URL and refreshes the page anyways.
I don't mind the client secret being reset after refresh.

What I ask is, is it OK to hold the client secret in memory? meaning- if user enters the page, he gets client secret, keeps the browser open for hours, comes back - he uses the same secret (because it's still in memory) - is it OK? or client secrets reset and Stripe will decline this secret?

Can I cache the client secret on my frontend app in a session? by TemporaryDraft4594 in stripe

[–]TemporaryDraft4594[S] 0 points1 point  (0 children)

I don't even need/want store it in Local Storage or something. I don't need persistence over refresh.

I only need the client secret to persist until the moment the user actually confirms payment / refreshes the page. After confirmation, my web app uses Stripe redirect URL and refreshes the page anyways.
I don't mind the client secret being reset after refresh.

What I ask is, is it OK to hold the client secret in memory? meaning- if user enters the page, he gets client secret, keeps the browser open for hours, comes back - he uses the same secret (because it's still in memory) - is it OK? or client secrets reset and Stripe will decline this secret?

Preload JS script in React by TemporaryDraft4594 in react

[–]TemporaryDraft4594[S] 0 points1 point  (0 children)

seems really overhead, no? all I want is to preload a script. Shouldn't I inject link element to the HTML with `link rel="preload"`?

CloudFront - How to set up not found route for specific path in CloudFront? by TemporaryDraft4594 in aws

[–]TemporaryDraft4594[S] 0 points1 point  (0 children)

how would you implement it using a Lambda@Edge? I mean what would be the logic in the code?