0

I wanted to pass query param in hidden format. I mean, not like /register?plan=private but like /register. I should be able to pass plan value as private and can access it easily.

How this is feasible in vuejs please guide. It would be good if we can have codepen example.

// with query, resulting in /register?plan=private
router.push({ path: 'register', query: { plan: 'private' }})
Neha Soni
  • 3,935
  • 2
  • 10
  • 32
simon
  • 359
  • 1
  • 14
  • The only hidden way that hits my mind is to use the store. You can use *$root$ or localStorage ... but anyone with code experience can see it. – Amini Feb 26 '23 at 09:04

1 Answers1

-1

The query params you want to hide don't look very confidential, so why need to hide the params?

Besides, as far as I understand, you cannot hide the query parameters. Even if you use the post method instead of the get method, you can still see the passed parameters in the network request.

One way to hide (not hide actually) the query params is to encrypt the params to make it a difficult read. Here is an example to do this. Give a read to this article as well.

But again, encryption requires many other things in the box too, and encryption is needed only for confidential data. So, I would suggest figuring out your use case first and deciding why you need to hide the parameters.

Neha Soni
  • 3,935
  • 2
  • 10
  • 32