codehakase / golang-gin

Build a Golang app with the Gin framework, and authenticate with Auth0 + JWT

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Serving Static files based on Authentication

lucianthorr opened this issue · comments

I've been working on a similar setup with Gin and React. I see how the auth is being used to control the api responses but have you found a way to use authentication in Gin to control the javascript that is being served?
From my understanding, the user is receiving the entire frontend regardless of their auth-status.

What if you only wanted to serve the joke button after a user has been successfully logged in?