Comments (9)
I'm rusty with my Haskell skills. I'll take a look to see if I can push a fix for this one.
Might even not need any, or very little haskell -> this is likely sometihng that will mostly need templates intervention. What might be hard is just getting the development flow to work for the first time, since the system is a bit complex, in some ways. But we would be happy to help! If you do want to give it a try, feel free to ask for any help in Discord regarding setup and similar. We tried to put a lot of info into waspc/README.md, but it might be confusing still.
from open-saas.
Great find @Case-E ! So this is not a bug in Wasp, but is actually a relatively unexpected behaviour that is part of OpenSaas, correct?
Let me move this issue to open-saas repo then and we can figure it out there.
Just to be clear, the behaviour you are suggesting is to remove this automatic redirecting of logged in users from /login
to /
. I agree, it seems to assume a bit too much. Better to have them stay on login
and let devs impelment this redirect on their own if they want. Or, as you said, if we could reuse the value provided in onAuthSucceededRedirectTo
. But I don't think we have an easy way to do that at the moment, and an option where they can redirect users on their own sounds completely fine.
Yeah, I would just vote for removing this history.push
and that is it.
from open-saas.
Thanks @Case-E !
from open-saas.
I'm rusty with my Haskell skills. I'll take a look to see if I can push a fix for this one.
from open-saas.
I was looking in the Wasp code base and couldn't really find anything that would be causing this. So I looked in my code and realised the culprit was right there! 🤦
I copied the page over from OpenSaaS and didn't think to check it.
![image](https://private-user-images.githubusercontent.com/25521878/340802810-3425d009-26a6-4f43-b64f-ea38e4c29556.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg5NTQyODcsIm5iZiI6MTcxODk1Mzk4NywicGF0aCI6Ii8yNTUyMTg3OC8zNDA4MDI4MTAtMzQyNWQwMDktMjZhNi00ZjQzLWI2NGYtZWEzOGU0YzI5NTU2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjIxVDA3MTMwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ4YTFhOGEzYmUyZWIxMzFlZjY5MTBjMmMwMDdmYmYxYTM1OGViZDIzOTMwMWYwMGNmMWFkN2E5Y2VjYTgyYjImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.5_i0njpRnBSb0rhxb7-3l-N9Fnv5uc2iObdVGVu9jRE)
So removing that part, makes the login page load. We could probably make this an FR instead of a bug where the loginRoute could automatically redirect the user to onAuthSucceededRedirectTo or may be change it to a docs thing as this is something that devs can incorporate into their code.
from open-saas.
@vincanger what do you think?
from open-saas.
yep. I'll remove that now @Martinsos. Thanks for catching this @Case-E.
If you still wanna redirect logged in users, the best way is actually to do this:
import { Redirect } from 'react-router-dom';
export default function Login() {
const { data: user } = useAuth();
if (user) {
return <Redirect to='/demo-app' />;
}
from open-saas.
here is the PR for removing the redirect and creating a new diff for opensaas.sh #182
from open-saas.
Thanks @Martinsos and @vincanger! :D
from open-saas.
Related Issues (20)
- Potentially improve the docs for file upload
- No stripe webhook trigger + cumulative subscription HOT 2
- update openAI sdk to latest version
- Add zod checks to social auth user fields getters
- setUsername.ts does more than the name says
- Drop (or modify) the suggestion to update your open-saas app HOT 1
- SendGris Issue HOT 1
- improve opensaas app_diff patching instructions for mac
- Consider gitignoring package-lock.json in template/app and opensaas-sh/app(_diff) HOT 2
- type fileArgs -> rename to type FileDescription (in server/actions.ts)
- Avast says opensaas.sh is malicious! HOT 20
- SDK Build Error HOT 1
- e2e tests failing with cookie banner check HOT 1
- Stripe Integration, address and Name HOT 6
- 【feature request】lemon squeezy HOT 2
- deploy open-saas on Google Cloud Platform (firebase + cloud run) HOT 4
- deploy open-saas on AWS HOT 1
- Refactor <Link /> components from React-Router to Wasp Links HOT 1
- Deepen the feature-set for subscriptions / e commerce
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from open-saas.