Giter VIP home page Giter VIP logo

Comments (9)

Martinsos avatar Martinsos commented on July 22, 2024 1

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.

Martinsos avatar Martinsos commented on July 22, 2024 1

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.

Martinsos avatar Martinsos commented on July 22, 2024

Thanks @Case-E !

from open-saas.

Case-E avatar Case-E commented on July 22, 2024

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.

Case-E avatar Case-E commented on July 22, 2024

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

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.

Martinsos avatar Martinsos commented on July 22, 2024

@vincanger what do you think?

from open-saas.

vincanger avatar vincanger commented on July 22, 2024

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.

vincanger avatar vincanger commented on July 22, 2024

here is the PR for removing the redirect and creating a new diff for opensaas.sh #182

from open-saas.

Case-E avatar Case-E commented on July 22, 2024

Thanks @Martinsos and @vincanger! :D

from open-saas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.