Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions lib/Controller/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ public function isDiscoveryEndpointValid($url) {
return $result;
}

/**
* @PasswordConfirmationRequired
*/
public function createProvider(string $identifier, string $clientId, string $clientSecret, string $discoveryEndpoint,
array $settings = [], string $scope = 'openid email profile', ?string $endSessionEndpoint = null): JSONResponse {
if ($this->providerService->getProviderByIdentifier($identifier) !== null) {
Expand Down Expand Up @@ -103,6 +106,9 @@ public function createProvider(string $identifier, string $clientId, string $cli
return new JSONResponse(array_merge($provider->jsonSerialize(), ['settings' => $providerSettings]));
}

/**
* @PasswordConfirmationRequired
*/
public function updateProvider(int $providerId, string $identifier, string $clientId, string $discoveryEndpoint, ?string $clientSecret = null,
array $settings = [], string $scope = 'openid email profile', ?string $endSessionEndpoint = null): JSONResponse {
$provider = $this->providerMapper->getProvider($providerId);
Expand Down Expand Up @@ -139,6 +145,9 @@ public function updateProvider(int $providerId, string $identifier, string $clie
return new JSONResponse(array_merge($provider->jsonSerialize(), ['settings' => $providerSettings]));
}

/**
* @PasswordConfirmationRequired
*/
public function deleteProvider(int $providerId): JSONResponse {
try {
$provider = $this->providerMapper->getProvider($providerId);
Expand All @@ -160,6 +169,9 @@ public function getID4ME(): bool {
return $this->id4meService->getID4ME();
}

/**
* @PasswordConfirmationRequired
*/
public function setID4ME(bool $enabled): JSONResponse {
$this->id4meService->setID4ME($enabled);
return new JSONResponse(['enabled' => $this->getID4ME()]);
Expand Down
20 changes: 20 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@nextcloud/dialogs": "^5.3.7",
"@nextcloud/initial-state": "^2.2.0",
"@nextcloud/logger": "^2.7.0",
"@nextcloud/password-confirmation": "^5.1.1",
"@nextcloud/router": "^3.0.1",
"@nextcloud/vue": "^8.19.0",
"jstz": "^2.1.1",
Expand Down
5 changes: 5 additions & 0 deletions src/components/AdminSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ import NcActions from '@nextcloud/vue/dist/Components/NcActions.js'
import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js'
import NcModal from '@nextcloud/vue/dist/Components/NcModal.js'
import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
import { confirmPassword } from '@nextcloud/password-confirmation'

import logger from '../logger.js'
import SettingsForm from './SettingsForm.vue'
Expand Down Expand Up @@ -175,6 +176,7 @@ export default {

this.loadingId4Me = true
try {
await confirmPassword()
const url = generateUrl('/apps/user_oidc/provider/id4me')

await axios.post(url, {
Expand All @@ -194,6 +196,7 @@ export default {
this.editProvider = null
},
async onUpdate(provider) {
await confirmPassword()
logger.info('Update oidc provider', { data: provider })

const url = generateUrl(`/apps/user_oidc/provider/${provider.id}`)
Expand All @@ -208,6 +211,7 @@ export default {
}
},
async onRemove(provider) {
await confirmPassword()
logger.info('Remove oidc provider', { provider })

const url = generateUrl(`/apps/user_oidc/provider/${provider.id}`)
Expand All @@ -221,6 +225,7 @@ export default {
}
},
async onSubmit() {
await confirmPassword()
logger.info('Add new oidc provider', { data: this.newProvider })

const url = generateUrl('/apps/user_oidc/provider')
Expand Down
Loading