Prefix
WWasp-lang
•Created by Prefix on 11/18/2024 in #đŸ™‹questions
Redirect user if authenticated?
Is there a way to do a server-side redirect if the user is authenticated?
i.e: if a user is logged in, I do not want them to be able to go to the
/login
page, and should instead be redirected back to their /dashboard
.
I'm aware I can do this with a client-side check on the useAuth()
object, but that would still enable a single render of the "gated" content before redirecting (i.e if using a useEffect()
).
Is there a way to configure some whenAuthenticated
guard in the main.wasp
?8 replies
WWasp-lang
•Created by Prefix on 11/17/2024 in #đŸ™‹questions
fly deploy pointing to wrong server URL
I am trying to deploy a postgres + websockets Wasp app to Fly, following the deploy instructions here: https://wasp-lang.dev/docs/advanced/deployment/cli
App works correctly locally.
I ran:
wasp deploy fly launch my-wasp-app mia
This created 3 apps:
- my-wasp-app-client-morning-feather-500
- my-wasp-app-server-broken-mountain-1141
- my-wasp-app-broken-mountain-1141-db
When I visit the client app URL, I see the Wasp loading spinner, however requests are failing:
- ERR_NAME_NOT_RESOLVED
for request to https://my-wasp-app-morning-feather-500-server.fly.dev/auth/me
- socket requests are failing
Looking at the names, it looks like the client was given the incorrect server name? my-wasp-app-morning-feather-500-server
but it should be my-wasp-app-server-broken-mountain-1141
.
This might have been an issue during the deploy, where the CLI timed out waiting for the apps to be available. I re-ran the command since the TOML files were correctly created assuming it would pick off where it left off, but not sure what happened.
1: is there a way to fix this?
2: is this a known issue?8 replies