# Bug OP-7661 - OAuth login has CSP issues when user already had authorized the app

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

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions | 11.2.0 |
| Observed in versions |  |
| Sprint | 11.2.0 |
| 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 |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

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

## Costs

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

## Description

OAuth redirects to the URL as specified in the app. However, the post to that URL is not allowed if the user already granted access. This is due to fact that the very first form, the login in that case had not CSP form-action set to the redirect URLs.

**Steps to reproduce**

1.  Create OAuth app locally with [`https://oauthdebugger.com/debug`](https://oauthdebugger.com/debug) as redirect\_uri
2.  Set up [https://oauthdebugger.com/debug](https://oauthdebugger.com/debug) in Chrome and do the first auth
3.  Log out from OpenProject
4.  Redo auth, get to log in form
5.  Log in, observe console log
