Hi Maxim,

My expertise in the area of client-side webapp development is limited. From what I can fathom I’d say:

  • Use buttons for cases where you want the user to stay on the same page. Tie the backend API call to the button click event (it sounds like you’re already doing something like this).
  • For situations where the user should be sent to a different page, use a form submission followed by a server-side redirect upon success?

In any case I won’t recommend injecting ID tokens into hyperlinks. It just results in all sorts of weirdness. If the user leaves a page open for a while, the ID tokens will expire, and all the links will become invalid.

I’d also recommend you to ask around in Stackoverflow. Your question will receive more visibility, and hopefully somebody knows this area better than me can help you out. Good luck!

Written by

Software engineer at Google. Enjoys working at the intersection of cloud, mobile and programming languages. Fan of all things tech and open source.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store