Skip to content

Security concerns - Use case: API endpoints as vars #3

Open
@IoannisPetridis

Description

@IoannisPetridis

Hello maybe I am missing something here but since the env object can be edited by anyone through the console, then I suppose we don't really gain a lot by exposing it through the index.html right? I am trying to do something similar in my project by using similarly an env var that would expose api endpoints during runtime, and I am wondering if a possible solution would be to call Object.freeze() on that ? So like this:

<title>React App</title>
    <script>
        env = Object.freeze(%REACT_APP_ENV%)
    </script>
</head>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions