mirror of
https://github.com/plankanban/planka.git
synced 2025-12-20 01:14:12 +03:00
feat: Add ability to configure and test SMTP via UI
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
* /config:
|
||||
* get:
|
||||
* summary: Get application configuration
|
||||
* description: Retrieves the application configuration.
|
||||
* description: Retrieves the application configuration. Requires admin privileges.
|
||||
* tags:
|
||||
* - Config
|
||||
* operationId: getConfig
|
||||
@@ -24,39 +24,14 @@
|
||||
* properties:
|
||||
* item:
|
||||
* $ref: '#/components/schemas/Config'
|
||||
* security: []
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
async fn() {
|
||||
const { currentUser } = this.req;
|
||||
|
||||
const oidcClient = await sails.hooks.oidc.getClient();
|
||||
|
||||
let oidc = null;
|
||||
if (oidcClient) {
|
||||
const authorizationUrlParams = {
|
||||
scope: sails.config.custom.oidcScopes,
|
||||
};
|
||||
|
||||
if (!sails.config.custom.oidcUseDefaultResponseMode) {
|
||||
authorizationUrlParams.response_mode = sails.config.custom.oidcResponseMode;
|
||||
}
|
||||
|
||||
oidc = {
|
||||
authorizationUrl: oidcClient.authorizationUrl(authorizationUrlParams),
|
||||
endSessionUrl: oidcClient.issuer.end_session_endpoint ? oidcClient.endSessionUrl({}) : null,
|
||||
isEnforced: sails.config.custom.oidcEnforced,
|
||||
};
|
||||
}
|
||||
const config = await Config.qm.getOneMain();
|
||||
|
||||
return {
|
||||
item: sails.helpers.config.presentOne(
|
||||
{
|
||||
oidc,
|
||||
},
|
||||
currentUser,
|
||||
),
|
||||
item: sails.helpers.config.presentOne(config),
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user