Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context in SLACK_SUCCESS_REDIRECT_URL #25

Open
ianmobbs opened this issue Feb 5, 2019 · 1 comment
Open

Context in SLACK_SUCCESS_REDIRECT_URL #25

ianmobbs opened this issue Feb 5, 2019 · 1 comment

Comments

@ianmobbs
Copy link

ianmobbs commented Feb 5, 2019

Hi @izdi,

Thanks for the awesome package! I've been using it in a personal project, but I'm unsure of how to access the current users Slack information in the SLACK_SUCCESS_REDIRECT_URL. While it is being stored in the database, getting the "most recently created access token" after redirection seems to introduce all sorts of race conditions. When checking request.user in the redirected view, all it displays is AnonymousUser. I assumed any information set on the request object would be available, but it looks like creating a new HttpResponseRedirect (views.py#L117) also creates a new request object, wiping any information stored on it from your pipelines. What's your recommended solution to this problem?

Thanks!

@ianmobbs
Copy link
Author

ianmobbs commented Feb 5, 2019

Would still love a response, but here's how I solved in in the meantime: I created a custom SlackUser object with a session attribute, and as the first part of my pipeline I get_or_create a new SlackUser then update the session attribute using request.COOKIES['session']. After redirecting to SLACK_SUCCESS_REDIRECT_URL, I get the SlackUser with the same session!

@github-staff github-staff deleted a comment from p4u1d34n Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant