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

Fix issue 404 redirect after login as attendee with tickets #208

Merged
merged 1 commit into from
Sep 29, 2024

Conversation

lcduong
Copy link
Contributor

@lcduong lcduong commented Sep 27, 2024

This PR fix issue 404 redirect after login as attendee with tickets by get current path.

How has this been tested?

Checklist

  • I have added tests to cover my changes.

Summary by Sourcery

Fix the 404 redirect issue for attendees logging in with tickets by ensuring the redirect URL uses the current path.

Bug Fixes:

  • Fix the 404 redirect issue after logging in as an attendee with tickets by updating the redirect URL to use the current path.

Copy link

sourcery-ai bot commented Sep 27, 2024

Reviewer's Guide by Sourcery

This pull request fixes a 404 redirect issue that occurred after login as an attendee with tickets. The change involves modifying the 'next' parameter in the login URL to use the current path instead of a hardcoded value.

No sequence diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Update login URL to use dynamic path for redirect
  • Replace hardcoded '/{{ request.event.slug }}/schedule/' with '{{ request.path }}' in the 'next' parameter of the login URL
src/pretalx/common/templates/common/auth.html

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @lcduong - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Please provide more details on how this change was tested. Given that it affects login redirects, thorough testing is important.
  • The PR description could be more detailed. Please explain the root cause of the issue and why this change fixes it. Also, consider any potential side effects of using the current path for all redirects.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟡 Security: 1 issue found
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@@ -23,7 +23,7 @@
{% if eventyay_exists %}
{% if not no_buttons %}
<div class="text-center">
<a class="btn btn-lg btn-primary btn-block mt-3" href="{% provider_login_url request.event.organiser.slug %}?next=/{{ request.event.slug }}/schedule/">
<a class="btn btn-lg btn-primary btn-block mt-3" href="{% provider_login_url request.event.organiser.slug %}?next={{ request.path }}">
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 suggestion (security): Consider security implications of using request.path

The change from a hardcoded path to request.path could improve user experience by returning users to their original page after login. However, ensure that request.path is properly sanitized to prevent potential security issues like open redirects. Consider adding appropriate validation for the path before using it in the URL.

<a class="btn btn-lg btn-primary btn-block mt-3" href="{% provider_login_url request.event.organiser.slug %}?next={% url 'event-schedule' event=request.event.slug %}">
    {% translate "Login as Attendee with Eventyay-Ticket" %}
</a>

@mariobehling mariobehling merged commit 149d206 into fossasia:development Sep 29, 2024
8 checks passed
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

Successfully merging this pull request may close these issues.

2 participants