Giter VIP home page Giter VIP logo

Comments (13)

omab avatar omab commented on June 30, 2024

I saw some weird checks on code, I'll take a further look later, meanwhile you could use a "?next=" parameter in your URL, that will override the LOGIN_REDIRECT_URL redirect

from django-social-auth.

kevinpostal avatar kevinpostal commented on June 30, 2024

It also might be nice to modify
DEFAULT_REDIRECT = getattr(settings, 'LOGIN_REDIRECT_URL', '') in views

so you can specify a "SOCIAL_AUTH_LOGIN_REDIRECT_URL" and default to normal default redirect if not specified.

from django-social-auth.

omab avatar omab commented on June 30, 2024

I've added a setting to define a custom redirect URL as you suggested:

SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/another-url/'

Thanks!

from django-social-auth.

kevinpostal avatar kevinpostal commented on June 30, 2024

Thank you omab. Your support for this application is amazing :) keep up the great work.

The SOCIAL_AUTH_LOGIN_REDIRECT_URL works well, but it still leaves the original issue of displaying a page for when you FIRST register. This is useful if you need to display a thank you page upon registration.

I looked through the code, not sure how this would be accomplished. It looks like the rendering of the redirect url is very decoupled from the actual registration.

from django-social-auth.

omab avatar omab commented on June 30, 2024

I know this is not the correct way to do it, but meanwhile I fix this redirect non-sense, you could setup a handler for socialauth_registered that does an:

user.is_new = True

and then on your view check for the user status and display signup page or redirect to another place.

from django-social-auth.

JasonGiedymin avatar JasonGiedymin commented on June 30, 2024

Ah so your saying add a new property, and set it to True for later access. One must remember and set it to 'False' when done.

from django-social-auth.

omab avatar omab commented on June 30, 2024

Yeah, I won't call it a property, but a forced-hackish value instead :)

from django-social-auth.

mishrarohit avatar mishrarohit commented on June 30, 2024

From where should I send the socialauth_registered signal ? Also, where should its handler be defined ?

from django-social-auth.

omab avatar omab commented on June 30, 2024

The signal is sent by social_auth app, you should register a handler somewhere (usually on some models.py or init.py file).

from django-social-auth.

mishrarohit avatar mishrarohit commented on June 30, 2024

Thanks. Though I think we can have a SOCIAL_AUTH_REDIRECT_NEW parameter which will show a welcome page for new users and home page/REDIRECT_URL page for old users.

from django-social-auth.

omab avatar omab commented on June 30, 2024

Yes, it's in my plans.

from django-social-auth.

omab avatar omab commented on June 30, 2024

I've added a new settings SOCIAL_AUTH_NEW_USER_REDIRECT_URL to define a different redirect URL for new users.

from django-social-auth.

mishrarohit avatar mishrarohit commented on June 30, 2024

Thanks @omab. As others have commented, you are just awesome on this project.

from django-social-auth.

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.