Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.

User registration and password reset are broken due to the last_authenticated value being null#6458

Merged
ocket8888 merged 8 commits intoapache:masterfrom
srijeet0406:remove_null_last_authenticated
Jan 11, 2022
Merged

User registration and password reset are broken due to the last_authenticated value being null#6458
ocket8888 merged 8 commits intoapache:masterfrom
srijeet0406:remove_null_last_authenticated

Conversation

@srijeet0406
Copy link
Copy Markdown
Contributor

This PR closes #6457


Which Traffic Control components are affected by this PR?

  • Traffic Ops
  • Traffic Portal

What is the best way to verify this PR?

Run TP and TO, and verify that you can successfully register new users and reset passwords of existing users.

If this is a bugfix, which Traffic Control versions contained the bug?

  • master

PR submission checklist

@srijeet0406 srijeet0406 added this to the 6.1.0 milestone Jan 8, 2022
Comment thread traffic_portal/app/src/common/api/UserService.js Outdated
Comment thread traffic_ops/traffic_ops_golang/login/login.go Outdated
Comment thread traffic_ops/traffic_ops_golang/login/login.go Outdated
Comment thread traffic_ops/traffic_ops_golang/login/login.go Outdated
Comment thread traffic_portal/app/src/modules/private/user/UserController.js Outdated
Comment thread traffic_portal/app/src/common/api/UserService.js Outdated
Comment thread traffic_portal/app/src/common/api/UserService.js Outdated
Copy link
Copy Markdown
Contributor

@ocket8888 ocket8888 left a comment

Choose a reason for hiding this comment

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

This appears to fix the issue it's trying to fix, but I've discovered something troubling: the user is not required to set a password. The form can be submitted without setting a password, and that makes the token get dropped from the database, leaving the user with no way to authenticate, and that's not fixable without direct database manipulation. Also their cookie is immediately invalid so that the very next request 401's and there's no way to obtain a new cookie.

To reproduce: register a user, then go to the link in the email, set the full name as indicated by the form as being required, then submit the form. If you just wait like a minute a "newcount" logs request will be made that will cause a "user not found" error to be returned from the API and you'll be dropped back on the login page with no way to log in since you don't have a password.

This should be fixed, but if you think it's out-of-scope for this PR/just don't want to do it, I'll just merge it and open a new issue.

@ocket8888 ocket8888 added bug something isn't working as intended Traffic Ops related to Traffic Ops Traffic Portal v1 related to Traffic Portal version 1 labels Jan 11, 2022
@ocket8888
Copy link
Copy Markdown
Contributor

Solving that problem is more complicated than I initially thought, because of LDAP and OAuth users. I'll open an issue for it probably tomorrow. This PR doesn't need to try to fix the problem.

@ocket8888 ocket8888 merged commit 7fef9d6 into apache:master Jan 11, 2022
@zrhoffman zrhoffman added the authentication Relating to login, registration, passwords, tokens, etc. label Jan 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

authentication Relating to login, registration, passwords, tokens, etc. bug something isn't working as intended Traffic Ops related to Traffic Ops Traffic Portal v1 related to Traffic Portal version 1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

User registration and password reset are broken due to the last_authenticated value being null

4 participants