This PR includes implementation of refresh flow server and client side. Also includes some adjustments to documentation writing.
Warning ⚠️ : Updated to Next.js v14.1.1 since some route handlers had unexpected behavior. May have to update local and confirm everything works. But now we have semi-stable server actions. 🥳
Edit: 3/4 added logout functionality that invalidates tokens from Redis store
Changes
Server-side Changes
/refresh endpoint
/login/status endpoint to determine players authentication status
/logout endpoint to remove any cookies and invalidates active tokens
Added token.go and redis.go for implementation util
Use of Redis and accompanying changes like healthchecks and changes to docker-compose
Client-side Changes
Refresh Flow-Related Changes
/login/status for client side API
token.ts for server actions to refresh tokens and use fetch with refresh implementation
middleware.ts changes to redirect to login if user has no tokens
Changes to auth context to refresh tokens every 4 minutes 30 seconds
Appropriate changes to route handlers to have manual token refreshing if necessary
General
Adjusted wording to some documentation pages
Made breadcrumbs flex-wrap to prevent x-overflow for the buildings tab in Docs
Overview
This PR includes implementation of refresh flow server and client side. Also includes some adjustments to documentation writing.
Changes
Server-side Changes
/refresh
endpoint/login/status
endpoint to determine players authentication status/logout
endpoint to remove any cookies and invalidates active tokenstoken.go
andredis.go
for implementation utilClient-side Changes
Refresh Flow-Related Changes
/login/status
for client side APItoken.ts
for server actions to refresh tokens and use fetch with refresh implementationmiddleware.ts
changes to redirect to login if user has no tokensGeneral