[PR #20] [MERGED] check token need to handle invalid user & invalid token correctly #863

Closed
opened 2026-02-25 23:43:57 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/healthchecks/healthchecks/pull/20
Author: @diwu1989
Created: 12/19/2015
Status: Merged
Merged: 12/26/2015
Merged by: @cuu508

Base: masterHead: badToken


📝 Commits (1)

  • 2ebad09 check token redirect to login on bad token

📊 Changes

3 files changed (+21 additions, -7 deletions)

View changed files

📝 hc/accounts/tests/test_check_token.py (+12 -4)
📝 hc/accounts/tests/test_login.py (+5 -0)
📝 hc/accounts/views.py (+4 -3)

📄 Description

Try going to this URL:
https://healthchecks.io/accounts/check_token/invalid_user/invalid_token/

You'll get hit with the login page, and u can enter email all day long and it wouldn't work

Correct solution is to:

  • upon bad token or bad user, redirect over to login page
  • set a bad_link sentinel in the cookie for the login page to render the special invalid login message
  • clear the bad_link sentinel from session

with unit tests included


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/healthchecks/healthchecks/pull/20 **Author:** [@diwu1989](https://github.com/diwu1989) **Created:** 12/19/2015 **Status:** ✅ Merged **Merged:** 12/26/2015 **Merged by:** [@cuu508](https://github.com/cuu508) **Base:** `master` ← **Head:** `badToken` --- ### 📝 Commits (1) - [`2ebad09`](https://github.com/healthchecks/healthchecks/commit/2ebad09d142de179908ae9bc77997abe842404be) check token redirect to login on bad token ### 📊 Changes **3 files changed** (+21 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `hc/accounts/tests/test_check_token.py` (+12 -4) 📝 `hc/accounts/tests/test_login.py` (+5 -0) 📝 `hc/accounts/views.py` (+4 -3) </details> ### 📄 Description Try going to this URL: https://healthchecks.io/accounts/check_token/invalid_user/invalid_token/ You'll get hit with the login page, and u can enter email all day long and it wouldn't work Correct solution is to: - upon bad token or bad user, redirect over to login page - set a `bad_link` sentinel in the cookie for the login page to render the special invalid login message - clear the `bad_link` sentinel from session with unit tests included --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-25 23:43:57 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/healthchecks#863
No description provided.