# Bug OP-19287 - Redirect to /login is missing the URL query params

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-19287

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions | 17.5.0 |
| Observed in versions |  |
| Sprint |  |
| Backlog bucket |  |
| Bug found in version (deprecated) |  |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers | Oliver Günther |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

### Steps to reproduce

1.  Log out or open an incognito window.

2.  Navigate to <https://community.openproject.org/projects/openproject/work_packages/new?type=1> .

3.  Notice you're redirected to [`https://community.openproject.org/login?back_url=https%3A%2F%2Fcommunity.openproject.org%2Fprojects%2Fopenproject%2Fwork_packages%2Fnew`](https://community.openproject.org/login?back_url=https%3A%2F%2Fcommunity.openproject.org%2Fprojects%2Fopenproject%2Fwork_packages%2Fnew). Crucially, the `?type=1` query parameter that was in the original URL is now missing from the `back_url`.

4.  Log in.

### What is the buggy behavior?

  - After logging in I'm redirected in <https://community.openproject.org/projects/openproject/work_packages/new>, titled "New TASK" without a template.

### What is the expected behavior?

  - After logging in I should be redirected to <https://community.openproject.org/projects/openproject/work_packages/new?type=1>, title "New BUG", with its template.

### Workaround

  - Link the user to [`https://community.openproject.org/login?back_url=https%3A%2F%2Fcommunity.openproject.org%2Fprojects%2Fopenproject%2Fwork_packages%2Fnew%3Ftype%3D1`](https://community.openproject.org/login?back_url=https%3A%2F%2Fcommunity.openproject.org%2Fprojects%2Fopenproject%2Fwork_packages%2Fnew%3Ftype%3D1) , which always land them in the "New BUG" page whether or not they are already logged in.

### 

### Environment information

**OpenProject installation type**

I first found the bug in our on-prem deployment, but this bug affects the public instance at community.openproject.org as well.

**Browser / Operating System**

The redirect happens server side:

``` sh
curl -sI https://community.openproject.org/projects/openproject/work_packages/new?type=1 | grep -i Location
```

``` text
location: https://community.openproject.org/login?back_url=https%3A%2F%2Fcommunity.openproject.org%2Fprojects%2Fopenproject%2Fwork_packages%2Fnew
```

<br>
