DEV Community

Discussion on: Cryptographically protecting your SPA

 
Sloan, the sloth mascot
Comment deleted
 
matpk profile image
Matheus Adorni Dardenne

People giving bad feedback doesn't hurt.

It is representative. The code is about the same.

Thread Thread
 
victorwm profile image
Victor Nascimento

So it is as bad as I imagined. I literally did this in 5 minutes.

Thread Thread
 
matpk profile image
Matheus Adorni Dardenne

If you did, how? You obviously didn't used devtools, as I'm explaining in another comment.
Image description

Thread Thread
 
victorwm profile image
Victor Nascimento

Care to explain what you are trying to convey with the attached image?

Thread Thread
 
matpk profile image
Matheus Adorni Dardenne

Just as a test to see if the changes made to the source files are applied. They're not. The browser is not webpack. You cannot change the readable source files and have the changes create a new compiled version. This is not how the devtools work.

In the image I changed the function in the source files the way you're suggesting you can, to purposefully fail the verification. If this worked, the application on the left wouldn't show any data after a page refresh. It is still working, because these changes were not reflected.

Thread Thread
 
victorwm profile image
Victor Nascimento

Then it does not seem you used the tool correctly. My screenshot above was taken from devtools.

Again, the browser does not need to be Webpack for this to work - you are misinterpreting how this works.

Thread Thread
 
matpk profile image
Matheus Adorni Dardenne

I posted the screenshot showing the correct use.

I'll go through my notifications again, but I've seen no screenshot from you. Just texts.

The browser would have to be webpack in order for you to modify readable code and have it compile into a new working version. To do something remotely similar to what you want, you would have to modify the compiled version, which is not trivial and requires understanding of how React works under the hood. Any attempt at calling this trivial is.......... well, there are no polite ways of saying it, so I won't.

Thread Thread
 
victorwm profile image
Victor Nascimento

Modifying the compiled version is precisely what you need to do. But you don't need to understand how react works under the hood to do that.

It seems to me you're modifying the code translated from source maps and that won't work. As pointed, this is a misunderstanding of how the overrides tool works.

Thread Thread
 
victorwm profile image
Victor Nascimento

It's not because you don't know how to do it that it is not trivial, by the way.

Thread Thread
 
matpk profile image
Matheus Adorni Dardenne

"It seems to me you're modifying the code translated from source maps and that won't work"

Yes. I'm saying that it won't work for some 10 comments by now.

"As pointed, this is a misunderstanding of how the overrides tool works"

Yes, it IS a misunderstanding: of the people suggesting this is as something that trivially works as they naïvely thought. It doesn't. You have to change the compiled code, which is not trivial.