Using OAuth authorization code flow to get moderators of a channel

I would like to avoid using a database, do you think when I get the code in the URL after the user got redirected with the popup, I can put the code from the query in URL in localStorage and encode it until it expires ?

And then everytime the user comes in the page that fetches data, if the token has expired, I redirect him to the twitch popup, else I do the request with the token in localStorage