Coder Social home page Coder Social logo

Comments (3)

kayode-adechinan avatar kayode-adechinan commented on April 27, 2024 1

I understand much better. Thanks for the clarifications. I appreciate

from indie-stack.

machour avatar machour commented on April 27, 2024

Hitting directly /logout shouldn't log you out, as it is bad practice.

If you do that, I could put an image on my website like this:
<img src="https://yourwebsite/logout" />
and have all your users logged out from your website when they visit mine.
Or a prefetch on your own website could do that.
You don't want that.

Logout should only happens with POST (action) and this is how this stack is implementing it:
https://github.com/remix-run/indie-stack/blob/main/app/routes/logout.tsx

from indie-stack.

dvnrsn avatar dvnrsn commented on April 27, 2024

Edit: I see now I was confused. logout.tsx is a POST endpoint. I was mistakenly <Link>ing to it. But then I saw this in notes.tsx

        <Form action="/logout" method="post">
          <button
            type="submit"
            className="rounded bg-slate-600 px-4 py-2 text-blue-100 hover:bg-blue-500 active:bg-blue-600"
          >
            Logout
          </button>
        </Form>

I don't think it's working in the stack any more. The linked logout.tsx does have an action but the route automatically redirects. I'm assuming this is not desired

from indie-stack.

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.