Giter Club home page Giter Club logo

Comments (4)

aaugustin avatar aaugustin commented on July 29, 2024

The standard Django way is login_required which redirects to a login page.

You can change LOGIN_URL to something other than a login form if you don't have a login form because only django-sesame provides authentication.

from django-sesame.

samloomes avatar samloomes commented on July 29, 2024

Thanks for that Aymeric, that put me on the right track.

I ended up pointing the magic link to redirect view that uses the LoginRequiredMixin. On failure I send the user to the login view with a query string parameter to show an error message, otherwise I redirect to my homepage with a query string parameter to show a "you have been logged in message".

Think that covers it all. Again, just want to say that this is a great package, I can't see anything else out there handling this so nicely.

from django-sesame.

aaugustin avatar aaugustin commented on July 29, 2024

Yes, that's a smart way to achieve what you want!

I expect others may have the same need. I'm going to reopen the issue to check if I can find a good way to document it.

from django-sesame.

aaugustin avatar aaugustin commented on July 29, 2024

I reviewed this issue today. Mixing LoginRequiredMixin and RedirectView may yield the best result in your situation, however I don't think that's the most straightforward solution in general.

So I'm going to stick with the basic example in the "Per-view authentication" paragraph in the README. I'm adding more explanations so it's more likely to help someone with the same question as you.

from django-sesame.

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.