Query string not preserved after redirect to login page #2622

Closed
opened 2025-12-29 18:20:29 +01:00 by adam · 4 comments
Owner

Originally created by @eliezerlp on GitHub (May 17, 2019).

Environment

  • Python version: 2.7
  • NetBox version: vx2.3.3

Steps to Reproduce

  1. Ensure you have auth enabled in Netbox
  2. Ensure you are logged out.
  3. Try opening a URL similar to the following: http://netbox/dcim/devices/add/?status=1&manufacturer=1&name=Device-Name&asset_tag=Asset-Tag
  4. You will be redirected to the Login page. Enter your credentials and login.
  5. You will be taken to http://netbox/dcim/devices/add/ without any of the originally submitted query string parameters.

Expected Behavior

Query string parameters should be preserved and passed after logging in.

Observed Behavior

Query string parameters were discarded and not passed after logging in.

Originally created by @eliezerlp on GitHub (May 17, 2019). ### Environment * Python version: 2.7 * NetBox version: vx2.3.3 <!-- Describe in detail the exact steps that someone else can take to reproduce this bug using the current stable release of NetBox (or the current beta release where applicable). Begin with the creation of any necessary database objects and call out every operation being performed explicitly. If reporting a bug in the REST API, be sure to reconstruct the raw HTTP request(s) being made: Don't rely on a wrapper like pynetbox. --> ### Steps to Reproduce 1. Ensure you have auth enabled in Netbox 2. Ensure you are logged out. 3. Try opening a URL similar to the following: http://netbox/dcim/devices/add/?status=1&manufacturer=1&name=Device-Name&asset_tag=Asset-Tag 4. You will be redirected to the Login page. Enter your credentials and login. 5. You will be taken to http://netbox/dcim/devices/add/ without any of the originally submitted query string parameters. <!-- What did you expect to happen? --> ### Expected Behavior Query string parameters should be preserved and passed after logging in. <!-- What happened instead? --> ### Observed Behavior Query string parameters were discarded and not passed after logging in.
adam closed this issue 2025-12-29 18:20:29 +01:00
Author
Owner

@tb-killa commented on GitHub (May 17, 2019):

I don't know if this would be a good point because if this is allowed (if it's a bug it is okay for me) this could bring in strange things because this allowed to be modify object directly without your do after login.
For this type of manipulation I prefer the API usage.

@tb-killa commented on GitHub (May 17, 2019): I don't know if this would be a good point because if this is allowed (if it's a bug it is okay for me) this could bring in strange things because this allowed to be modify object directly without your do after login. For this type of manipulation I prefer the API usage.
Author
Owner

@eliezerlp commented on GitHub (May 17, 2019):

Keep in mind that if you are already logged in prior to opening the link it will work without issue. As such the concern is likely moot.

In my case I am specifically looking to add new objects to Netbox with some fields pre-poulated in the Add a new device page. Not all fields are being populated by the query string, only some. The rest are filled in by the user manually, and then they click on "Create" to actually add the device. In my example (which matches my use case) nothing is automatically being done aside from pre-filling specified fields.

@eliezerlp commented on GitHub (May 17, 2019): Keep in mind that if you are already logged in prior to opening the link it will work without issue. As such the concern is likely moot. In my case I am specifically looking to add new objects to Netbox with some fields pre-poulated in the _Add a new device_ page. Not all fields are being populated by the query string, only some. The rest are filled in by the user manually, and then they click on "Create" to actually add the device. In my example (which matches my use case) nothing is automatically being done aside from pre-filling specified fields.
Author
Owner

@DanSheps commented on GitHub (May 27, 2019):

I don't think we should be accepting this behavior for certain things, however:

https://netbox/dcim/devices/?site=S1

does not work either.

@DanSheps commented on GitHub (May 27, 2019): I don't think we should be accepting this behavior for certain things, however: https://netbox/dcim/devices/?site=S1 does not work either.
Author
Owner

@jeremystretch commented on GitHub (May 28, 2019):

NetBox version: vx2.3.3

I am not able to replicate this on the current stable release of NetBox (v2.5.12). Please upgrade try again.

@jeremystretch commented on GitHub (May 28, 2019): > NetBox version: vx2.3.3 I am not able to replicate this on the current stable release of NetBox (v2.5.12). Please upgrade try again.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2622