# Bug NEX-687 - [Backport] check-admin-config returns incorrect config status after integration 0Auth re-setup with project folder until admin settings page is loaded

Project: Stream Nextcloud app "OpenProject Integration"
Status: closed
URL: https://community.openproject.org/work_packages/NEX-687

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions |  Nextcloud Integration 2.12.0 |
| Observed in versions |  |
| Bug found in version (deprecated) |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers |  |
| Designer |  |
| Signed off by |  |
| Interest by |  |

## Planning

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

## Costs

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

## Description

### Steps to reproduce

1\. Setup integration with project folder

```text
curl -XPOST 'https://nextcloud.local/index.php/apps/integration_openproject/setup' \
-H'Content-Type: application/json' \
-d'{
 "values":{
  "openproject_instance_url": "https://openproject.local",
  "openproject_client_id": "client-id",
  "openproject_client_secret": "client-sec",
  "setup_project_folder": true,
  "setup_app_password": true,
  "default_enable_navigation": false,
  "default_enable_unified_search": false
 }
}' \
-u admin:admin
```

2\. Reset the integration setup from webUI (DO NOT delete OpenProject project folder, user and groups)

3\. Setup integration with PATCH

```text
curl -XPATCH 'https://nextcloud.local/index.php/apps/integration_openproject/setup' \
-H'Content-Type: application/json' \
-d'{
 "values":{
  "openproject_instance_url": "https://openproject.local",
  "openproject_client_id": "client-id",
  "openproject_client_secret": "client-sec",
  "setup_project_folder": false,
  "setup_app_password": true 
 }                
}' \
-u admin:admin
```

4\. Check the response.

5\. Also, check the admin config status by:

```bash
curl -s -XGET -uadmin:admin https://nextcloud.local/index.php/apps/integration_openproject/check-admin-config
```

<br>

### What is the buggy behavior?

we get response:

```json
{"status":false,"id":6,"nextcloud_oauth_client_name":"OpenProject client","openproject_redirect_uri":......}
```

and admin config status response:

```json
{"config_status_without_project_folder":false,"project_folder_setup_status":true}
```

<br>

### What is the expected behavior?

response should be:

```json
{"status":true,"id":6,"nextcloud_oauth_client_name":"OpenProject client","openproject_redirect_uri":......}
```

and admin config status response should be:

```json
{"config_status_without_project_folder":true,"project_folder_setup_status":true}
```

<br>

### Environment information

integration\_openproject 2.11 and nextcloud 32

**OpenProject installation type**

*   Docker-compose installation
    

**Browser**

*   [x] Chrome
*   [ ] Firefox
*   [ ] Safari
*   [ ] Mobile Safari
*   [ ] Other (please specify)

**Operating System**

*   [ ] Windows
*   [ ] Mac OS X
*   [ ] Mobile iOS
*   [ ] Mobile Android
*   [x] Linux (please specify distro)
*   [ ] Chrome OS
*   [ ] Other (please specify)

**Language**

_Please specify the browser language and the language of the OpenProject user for which the bug occurred._
