diff --git a/js/dist-typings/admin/SettingsPage.d.ts b/js/dist-typings/admin/SettingsPage.d.ts new file mode 100644 index 0000000..1594b69 --- /dev/null +++ b/js/dist-typings/admin/SettingsPage.d.ts @@ -0,0 +1,13 @@ +import ExtensionPage, { ExtensionPageAttrs } from 'flarum/admin/components/ExtensionPage'; +import Mithril from 'mithril'; +import { SettingsComponentOptions } from 'flarum/admin/components/AdminPage'; +export declare class SettingsPage extends ExtensionPage { + content(vnode: Mithril.VnodeDOM): JSX.Element; + oncreate(vnode: Mithril.VnodeDOM): void; + addRow(): void; + clientRows(): JSX.Element[]; + flarumClientSettings(clientNumber: number): SettingsComponentOptions[]; + generalClientSettings(): SettingsComponentOptions[]; + jwtSettings(): SettingsComponentOptions[]; + booleanSetting(setting: string): boolean; +} diff --git a/js/dist/admin.js b/js/dist/admin.js index 23dd3ad..da9c6a4 100644 --- a/js/dist/admin.js +++ b/js/dist/admin.js @@ -1,2 +1,2 @@ -(()=>{var t={n:n=>{var e=n&&n.__esModule?()=>n.default:()=>n;return t.d(e,{a:e}),e},d:(n,e)=>{for(var s in e)t.o(e,s)&&!t.o(n,s)&&Object.defineProperty(n,s,{enumerable:!0,get:e[s]})},o:(t,n)=>Object.prototype.hasOwnProperty.call(t,n),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};(()=>{"use strict";t.r(n);const e=flarum.core.compat["admin/app"];var s=t.n(e);function i(t,n){return i=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t},i(t,n)}const o=flarum.core.compat["admin/components/ExtensionPage"];var a=t.n(o);const l=flarum.core.compat["common/components/Button"];var r=t.n(l),c=function(t){var n,e;function o(){return t.apply(this,arguments)||this}e=t,(n=o).prototype=Object.create(e.prototype),n.prototype.constructor=n,i(n,e);var a=o.prototype;return a.content=function(t){var n=s().extensionData.getSettings(this.extension.id),e=this.flarumClientSettings(1);return m("div",{className:"ExtensionPage-settings"},m("div",{className:"container"},m("div",{className:"Form"},m("div",{className:"Form-group"},this.buildSettingComponent({type:"checkbox",label:"Provider mode",setting:"maicol07-sso.provider_mode",help:s().translator.trans("maicol07-sso.admin.settings.provider_mode"),className:"maicol07-sso--provider-mode"}),m("div",{hidden:!this.booleanSetting("provider_mode")},m("div",{className:"Form-group"},m("table",null,m("thead",null,m("tr",null,e.map((function(t){return m("th",{key:t.setting},t.label,m("br",null),m("span",{className:"helpText",style:{fontWeight:"normal"}},t.help))})))),m("tbody",null,this.clientRows()))),m(r(),{className:"Button","aria-label":"Add instance",icon:"fa fa-plus",onclick:this.addRow.bind(this)},"Add Flarum instance"))),m("div",{className:"Form-group",hidden:this.booleanSetting("provider_mode")},m("hr",null),m("div",{className:"Form-group"},this.generalClientSettings().map(this.buildSettingComponent.bind(this))),null==n?void 0:n.map(this.buildSettingComponent.bind(this)),m("hr",null),m("div",{className:"Form-group"},m("h4",null,s().translator.trans("maicol07-sso.admin.settings.jwt_section_subtitle")),this.jwtSettings().map(this.buildSettingComponent.bind(this)))),m("div",{className:"Form-group"},this.submitButton()))))},a.oncreate=function(n){t.prototype.oncreate.call(this,n),this.setting("maicol07-sso.provider_mode").map((function(){return m.redraw()}))},a.addRow=function(){var t=this.clientRows().length+1;s().data.settings["maicol07-sso.client"+t+"_url"]=""},a.clientRows=function(){for(var t=this,n=[],e=1;"maicol07-sso.client"+e+"_url"in s().data.settings;)n.push(m("tr",{key:"client"+e},this.flarumClientSettings(e).map((function(n){return n.label=void 0,n.help=void 0,m("td",{key:n.setting},t.buildSettingComponent(n))})))),e++;return n},a.flarumClientSettings=function(t){return[{setting:"maicol07-sso.client"+t+"_name",type:"text",label:s().translator.trans("maicol07-sso.admin.settings.client_name"),help:s().translator.trans("maicol07-sso.admin.settings.client_name_help")},{setting:"maicol07-sso.client"+t+"_url",type:"text",label:s().translator.trans("maicol07-sso.admin.settings.client_url"),help:s().translator.trans("maicol07-sso.admin.settings.client_url_help")},{setting:"maicol07-sso.client"+t+"_api_key",type:"password",label:s().translator.trans("maicol07-sso.admin.settings.client_api_key"),help:s().translator.trans("maicol07-sso.admin.settings.client_api_key_help")},{setting:"maicol07-sso.client"+t+"_password_token",type:"password",label:s().translator.trans("maicol07-sso.admin.settings.client_password_token"),help:s().translator.trans("maicol07-sso.admin.settings.client_password_token_help")},{setting:"maicol07-sso.client"+t+"_verify_ssl",type:"checkbox",label:s().translator.trans("maicol07-sso.admin.settings.client_verify_ssl"),help:s().translator.trans("maicol07-sso.admin.settings.client_verify_ssl_help")}]},a.generalClientSettings=function(){return[{setting:"maicol07-sso.login_url",label:s().translator.trans("maicol07-sso.admin.settings.login_url"),type:"url"},{setting:"maicol07-sso.signup_url",label:s().translator.trans("maicol07-sso.admin.settings.signup_url"),type:"url"},{setting:"maicol07-sso.logout_url",label:s().translator.trans("maicol07-sso.admin.settings.logout_url"),type:"url"},{setting:"maicol07-sso.manage_account_url",label:s().translator.trans("maicol07-sso.admin.settings.manage_account_url"),type:"url"},{setting:"maicol07-sso.cookies_prefix",label:s().translator.trans("maicol07-sso.admin.settings.cookies_prefix"),type:"text"}]},a.jwtSettings=function(){return[{setting:"maicol07-sso.jwt_iss",label:s().translator.trans("maicol07-sso.admin.settings.jwt_iss"),type:"text"},{setting:"maicol07-sso.jwt_signing_algorithm",label:s().translator.trans("maicol07-sso.admin.settings.jwt_signing_algorithm"),type:"select",options:{Sha256:"Sha256",Sha384:"Sha384",Sha512:"Sha512"},default:"Sha256"},{setting:"maicol07-sso.jwt_signer_key",label:s().translator.trans("maicol07-sso.admin.settings.jwt_signer_key"),type:"text"}]},a.booleanSetting=function(t){return Boolean(Number(this.setting("maicol07-sso."+t)()))},o}(a());s().initializers.add("maicol07-sso",(function(){s().extensionData.for("maicol07-sso").registerSetting({setting:"maicol07-sso.manage_account_btn_open_in_new_tab",label:s().translator.trans("maicol07-sso.admin.settings.manage_account_btn_open_in_new_tab"),type:"boolean"}).registerSetting({setting:"maicol07-sso.remove_login_btn",label:s().translator.trans("maicol07-sso.admin.settings.remove_login_btn"),type:"boolean"}).registerSetting({setting:"maicol07-sso.remove_signup_btn",label:s().translator.trans("maicol07-sso.admin.settings.remove_signup_btn"),type:"boolean"}).registerPage(c)}))})(),module.exports=n})(); +(()=>{var t={n:e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},d:(e,n)=>{for(var s in n)t.o(n,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:n[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};(()=>{"use strict";t.r(e);const n=flarum.core.compat["admin/app"];var s=t.n(n);function o(t,e){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},o(t,e)}const i=flarum.core.compat["admin/components/ExtensionPage"];var a=t.n(i);const l=flarum.core.compat["common/components/Button"];var r=t.n(l),c=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,o(e,n);var a=i.prototype;return a.content=function(t){var e=s().extensionData.getSettings(this.extension.id),n=this.flarumClientSettings(1);return m("div",{className:"ExtensionPage-settings"},m("div",{className:"container"},m("div",{className:"Form"},m("div",{className:"Form-group"},this.buildSettingComponent({type:"checkbox",label:"Provider mode",setting:"maicol07-sso.provider_mode",help:s().translator.trans("maicol07-sso.admin.settings.provider_mode"),className:"maicol07-sso--provider-mode"}),m("div",{hidden:!this.booleanSetting("provider_mode")},m("div",{className:"Form-group"},m("table",null,m("thead",null,m("tr",null,n.map((function(t){return m("th",{key:t.setting},t.label,m("br",null),m("span",{className:"helpText",style:{fontWeight:"normal"}},t.help))})))),m("tbody",null,this.clientRows()))),m(r(),{className:"Button","aria-label":"Add instance",icon:"fa fa-plus",onclick:this.addRow.bind(this)},"Add Flarum instance"))),m("div",{className:"Form-group",hidden:this.booleanSetting("provider_mode")},m("hr",null),m("div",{className:"Form-group"},this.generalClientSettings().map(this.buildSettingComponent.bind(this))),null==e?void 0:e.map(this.buildSettingComponent.bind(this)),m("hr",null),m("div",{className:"Form-group"},m("h4",null,s().translator.trans("maicol07-sso.admin.settings.jwt_section_subtitle")),this.jwtSettings().map(this.buildSettingComponent.bind(this)))),m("div",{className:"Form-group"},this.submitButton()))))},a.oncreate=function(e){t.prototype.oncreate.call(this,e),this.setting("maicol07-sso.provider_mode").map((function(){return m.redraw()}))},a.addRow=function(){var t=this.clientRows().length+1;s().data.settings["maicol07-sso.client"+t+"_url"]=""},a.clientRows=function(){for(var t=this,e=[],n=1;"maicol07-sso.client"+n+"_url"in s().data.settings;)e.push(m("tr",{key:"client"+n},this.flarumClientSettings(n).map((function(e){return e.label=void 0,e.help=void 0,m("td",{key:e.setting},t.buildSettingComponent(e))})))),n++;return e},a.flarumClientSettings=function(t){return[{setting:"maicol07-sso.client"+t+"_name",type:"text",label:s().translator.trans("maicol07-sso.admin.settings.client_name"),help:s().translator.trans("maicol07-sso.admin.settings.client_name_help")},{setting:"maicol07-sso.client"+t+"_url",type:"text",label:s().translator.trans("maicol07-sso.admin.settings.client_url"),help:s().translator.trans("maicol07-sso.admin.settings.client_url_help")},{setting:"maicol07-sso.client"+t+"_api_key",type:"password",label:s().translator.trans("maicol07-sso.admin.settings.client_api_key"),help:s().translator.trans("maicol07-sso.admin.settings.client_api_key_help")},{setting:"maicol07-sso.client"+t+"_password_token",type:"password",label:s().translator.trans("maicol07-sso.admin.settings.client_password_token"),help:s().translator.trans("maicol07-sso.admin.settings.client_password_token_help")},{setting:"maicol07-sso.client"+t+"_verify_ssl",type:"checkbox",label:s().translator.trans("maicol07-sso.admin.settings.client_verify_ssl"),help:s().translator.trans("maicol07-sso.admin.settings.client_verify_ssl_help")}]},a.generalClientSettings=function(){return[{setting:"maicol07-sso.login_url",label:s().translator.trans("maicol07-sso.admin.settings.login_url"),type:"url"},{setting:"maicol07-sso.signup_url",label:s().translator.trans("maicol07-sso.admin.settings.signup_url"),type:"url"},{setting:"maicol07-sso.logout_url",label:s().translator.trans("maicol07-sso.admin.settings.logout_url"),type:"url"},{setting:"maicol07-sso.manage_account_url",label:s().translator.trans("maicol07-sso.admin.settings.manage_account_url"),type:"url"},{setting:"maicol07-sso.cookies_prefix",label:s().translator.trans("maicol07-sso.admin.settings.cookies_prefix"),type:"text"}]},a.jwtSettings=function(){return[{setting:"maicol07-sso.jwt_iss",label:s().translator.trans("maicol07-sso.admin.settings.jwt_iss"),type:"text"},{setting:"maicol07-sso.jwt_signing_algorithm",label:s().translator.trans("maicol07-sso.admin.settings.jwt_signing_algorithm"),type:"select",options:{Sha256:"Sha256",Sha384:"Sha384",Sha512:"Sha512"},default:"Sha256"},{setting:"maicol07-sso.jwt_signer_key",label:s().translator.trans("maicol07-sso.admin.settings.jwt_signer_key"),type:"text"}]},a.booleanSetting=function(t){return Boolean(Number(this.setting("maicol07-sso."+t)()))},i}(a());s().initializers.add("maicol07-sso",(function(){s().extensionData.for("maicol07-sso").registerSetting({setting:"maicol07-sso.manage_account_btn_open_in_new_tab",label:s().translator.trans("maicol07-sso.admin.settings.manage_account_btn_open_in_new_tab"),type:"boolean"}).registerSetting({setting:"maicol07-sso.remove_login_btn",label:s().translator.trans("maicol07-sso.admin.settings.remove_login_btn"),type:"boolean"}).registerSetting({setting:"maicol07-sso.remove_signup_btn",label:s().translator.trans("maicol07-sso.admin.settings.remove_signup_btn"),type:"boolean"}).registerPage(c)}))})(),module.exports=e})(); //# sourceMappingURL=admin.js.map \ No newline at end of file diff --git a/js/dist/admin.js.map b/js/dist/admin.js.map index 447f6aa..c378456 100644 --- a/js/dist/admin.js.map +++ b/js/dist/admin.js.map @@ -1 +1 @@ -{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAO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D,MAAOT,IAAAA,WAAAA,MAAqB,uCAC5BQ,KAAM,QAER,CACEE,QAAS,qCACTD,MAAOT,IAAAA,WAAAA,MAAqB,qDAC5BQ,KAAM,SACN0B,QAAS,CACPC,OAAQ,SACRC,OAAQ,SACRC,OAAQ,UAEVC,QAAS,UAEX,CACE5B,QAAS,8BACTD,MAAOT,IAAAA,WAAAA,MAAqB,8CAC5BQ,KAAM,QAGX,EAtLH,EAwLEK,eAAA,SAAeH,GACb,OAAO6B,QAAQC,OAAOvC,KAAKS,QAAL,gBAA6BA,EAA7BT,IACvB,EA1LH,GAAkCwC,KEHlCzC,IAAAA,aAAAA,IAAqB,gBAAgB,WACnCA,IAAAA,cAAAA,IACO,gBACJ0C,gBAAgB,CACfhC,QAAS,kDACTD,MAAOT,IAAAA,WAAAA,MAAqB,kEAC5BQ,KAAM,YAEPkC,gBAAgB,CACfhC,QAAS,gCACTD,MAAOT,IAAAA,WAAAA,MAAqB,gDAC5BQ,KAAM,YAEPkC,gBAAgB,CACfhC,QAAS,iCACTD,MAAOT,IAAAA,WAAAA,MAAqB,iDAC5BQ,KAAM,YAEPmC,aAAanD,EACjB,G","sources":["webpack://@maicol07/flarum-ext-sso/webpack/bootstrap","webpack://@maicol07/flarum-ext-sso/webpack/runtime/compat get default export","webpack://@maicol07/flarum-ext-sso/webpack/runtime/define property getters","webpack://@maicol07/flarum-ext-sso/webpack/runtime/hasOwnProperty shorthand","webpack://@maicol07/flarum-ext-sso/webpack/runtime/make namespace object","webpack://@maicol07/flarum-ext-sso/external root \"flarum.core.compat['admin/app']\"","webpack://@maicol07/flarum-ext-sso/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@maicol07/flarum-ext-sso/external root \"flarum.core.compat['admin/components/ExtensionPage']\"","webpack://@maicol07/flarum-ext-sso/external root \"flarum.core.compat['common/components/Button']\"","webpack://@maicol07/flarum-ext-sso/./src/admin/SettingsPage.tsx","webpack://@maicol07/flarum-ext-sso/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@maicol07/flarum-ext-sso/./src/admin/index.tsx"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/ExtensionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","import ExtensionPage, { ExtensionPageAttrs } from 'flarum/admin/components/ExtensionPage';\nimport app from 'flarum/admin/app';\nimport Mithril from 'mithril';\nimport { SettingsComponentOptions } from 'flarum/admin/components/AdminPage';\nimport Button from 'flarum/common/components/Button';\n\nexport class SettingsPage extends ExtensionPage {\n content(vnode: Mithril.VnodeDOM): JSX.Element {\n const settings = app.extensionData.getSettings(this.extension.id);\n\n const flarumSettings = this.flarumClientSettings(1);\n\n return (\n
\n
\n
\n
\n {this.buildSettingComponent({\n type: 'checkbox',\n label: 'Provider mode',\n setting: 'maicol07-sso.provider_mode',\n help: app.translator.trans('maicol07-sso.admin.settings.provider_mode'),\n className: 'maicol07-sso--provider-mode',\n })}\n \n
\n\n \n\n
{this.submitButton()}
\n
\n
\n
\n );\n }\n\n oncreate(vnode: Mithril.VnodeDOM) {\n super.oncreate(vnode);\n this.setting('maicol07-sso.provider_mode').map(() => m.redraw());\n }\n\n addRow() {\n const next = this.clientRows().length + 1;\n app.data.settings[`maicol07-sso.client${next}_url`] = '';\n }\n\n clientRows() {\n const clientRows = [];\n\n let i = 1;\n while (`maicol07-sso.client${i}_url` in app.data.settings) {\n clientRows.push(\n \n {this.flarumClientSettings(i).map((setting) => {\n setting.label = undefined;\n setting.help = undefined;\n return {this.buildSettingComponent(setting)};\n })}\n \n );\n i++;\n }\n\n return clientRows;\n }\n\n flarumClientSettings(clientNumber: number): SettingsComponentOptions[] {\n return [\n {\n setting: `maicol07-sso.client${clientNumber}_name`,\n type: 'text',\n label: app.translator.trans('maicol07-sso.admin.settings.client_name'),\n help: app.translator.trans('maicol07-sso.admin.settings.client_name_help'),\n },\n {\n setting: `maicol07-sso.client${clientNumber}_url`,\n type: 'text',\n label: app.translator.trans('maicol07-sso.admin.settings.client_url'),\n help: app.translator.trans('maicol07-sso.admin.settings.client_url_help'),\n },\n {\n setting: `maicol07-sso.client${clientNumber}_api_key`,\n type: 'password',\n label: app.translator.trans('maicol07-sso.admin.settings.client_api_key'),\n help: app.translator.trans('maicol07-sso.admin.settings.client_api_key_help'),\n },\n {\n setting: `maicol07-sso.client${clientNumber}_password_token`,\n type: 'password',\n label: app.translator.trans('maicol07-sso.admin.settings.client_password_token'),\n help: app.translator.trans('maicol07-sso.admin.settings.client_password_token_help'),\n },\n {\n setting: `maicol07-sso.client${clientNumber}_verify_ssl`,\n type: 'checkbox',\n label: app.translator.trans('maicol07-sso.admin.settings.client_verify_ssl'),\n help: app.translator.trans('maicol07-sso.admin.settings.client_verify_ssl_help'),\n },\n ];\n }\n\n generalClientSettings(): SettingsComponentOptions[] {\n return [\n {\n setting: 'maicol07-sso.login_url',\n label: app.translator.trans('maicol07-sso.admin.settings.login_url'),\n type: 'url',\n },\n {\n setting: 'maicol07-sso.signup_url',\n label: app.translator.trans('maicol07-sso.admin.settings.signup_url'),\n type: 'url',\n },\n {\n setting: 'maicol07-sso.logout_url',\n label: app.translator.trans('maicol07-sso.admin.settings.logout_url'),\n type: 'url',\n },\n {\n setting: 'maicol07-sso.manage_account_url',\n label: app.translator.trans('maicol07-sso.admin.settings.manage_account_url'),\n type: 'url',\n },\n {\n setting: 'maicol07-sso.cookies_prefix',\n label: app.translator.trans('maicol07-sso.admin.settings.cookies_prefix'),\n type: 'text',\n },\n ];\n }\n\n jwtSettings(): SettingsComponentOptions[] {\n return [\n {\n setting: 'maicol07-sso.jwt_iss',\n label: app.translator.trans('maicol07-sso.admin.settings.jwt_iss'),\n type: 'text',\n },\n {\n setting: 'maicol07-sso.jwt_signing_algorithm',\n label: app.translator.trans('maicol07-sso.admin.settings.jwt_signing_algorithm'),\n type: 'select',\n options: {\n Sha256: 'Sha256',\n Sha384: 'Sha384',\n Sha512: 'Sha512',\n },\n default: 'Sha256',\n },\n {\n setting: 'maicol07-sso.jwt_signer_key',\n label: app.translator.trans('maicol07-sso.admin.settings.jwt_signer_key'),\n type: 'text',\n },\n ];\n }\n\n booleanSetting(setting: string): boolean {\n return Boolean(Number(this.setting(`maicol07-sso.${setting}`)()));\n }\n}\n","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","import app from 'flarum/admin/app';\nimport { SettingsPage } from './SettingsPage';\n\napp.initializers.add('maicol07-sso', () => {\n app.extensionData\n .for('maicol07-sso')\n .registerSetting({\n setting: 'maicol07-sso.manage_account_btn_open_in_new_tab',\n label: app.translator.trans('maicol07-sso.admin.settings.manage_account_btn_open_in_new_tab'),\n type: 'boolean',\n })\n .registerSetting({\n setting: 'maicol07-sso.remove_login_btn',\n label: app.translator.trans('maicol07-sso.admin.settings.remove_login_btn'),\n type: 'boolean',\n })\n .registerSetting({\n setting: 'maicol07-sso.remove_signup_btn',\n label: app.translator.trans('maicol07-sso.admin.settings.remove_signup_btn'),\n type: 'boolean',\n })\n .registerPage(SettingsPage);\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","_setPrototypeOf","p","setPrototypeOf","__proto__","SettingsPage","subClass","superClass","create","constructor","content","vnode","settings","app","this","extension","id","flarumSettings","flarumClientSettings","className","buildSettingComponent","type","label","setting","help","hidden","booleanSetting","map","style","fontWeight","clientRows","icon","onclick","addRow","bind","generalClientSettings","jwtSettings","submitButton","oncreate","m","redraw","next","length","i","push","undefined","clientNumber","options","Sha256","Sha384","Sha512","default","Boolean","Number","ExtensionPage","registerSetting","registerPage"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,W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C,OAAQ,SACRC,OAAQ,UAEVC,QAAS,UAEX,CACE5B,QAAS,8BACTD,MAAOV,IAAAA,WAAAA,MAAqB,8CAC5BS,KAAM,QAGZ,EAACb,EAEDkB,eAAA,SAAeH,GACb,OAAO6B,QAAQC,OAAOxC,KAAKU,QAAQ,gBAAgBA,EAA7BV,IACxB,EAACb,CAAA,CA1LsB,CAASsD,KEHlC1C,IAAAA,aAAAA,IAAqB,gBAAgB,WACnCA,IAAAA,cAAAA,IACO,gBACJ2C,gBAAgB,CACfhC,QAAS,kDACTD,MAAOV,IAAAA,WAAAA,MAAqB,kEAC5BS,KAAM,YAEPkC,gBAAgB,CACfhC,QAAS,gCACTD,MAAOV,IAAAA,WAAAA,MAAqB,gDAC5BS,KAAM,YAEPkC,gBAAgB,CACfhC,QAAS,iCACTD,MAAOV,IAAAA,WAAAA,MAAqB,iDAC5BS,KAAM,YAEPmC,aAAaxD,EAClB,G","sources":["webpack://@maicol07/flarum-ext-sso/webpack/bootstrap","webpack://@maicol07/flarum-ext-sso/webpack/runtime/compat get default export","webpack://@maicol07/flarum-ext-sso/webpack/runtime/define property getters","webpack://@maicol07/flarum-ext-sso/webpack/runtime/hasOwnProperty shorthand","webpack://@maicol07/flarum-ext-sso/webpack/runtime/make namespace object","webpack://@maicol07/flarum-ext-sso/external root \"flarum.core.compat['admin/app']\"","webpack://@maicol07/flarum-ext-sso/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@maicol07/flarum-ext-sso/external root \"flarum.core.compat['admin/components/ExtensionPage']\"","webpack://@maicol07/flarum-ext-sso/external root \"flarum.core.compat['common/components/Button']\"","webpack://@maicol07/flarum-ext-sso/./src/admin/SettingsPage.tsx","webpack://@maicol07/flarum-ext-sso/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@maicol07/flarum-ext-sso/./src/admin/index.tsx"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/ExtensionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","import ExtensionPage, { ExtensionPageAttrs } from 'flarum/admin/components/ExtensionPage';\nimport app from 'flarum/admin/app';\nimport Mithril from 'mithril';\nimport { SettingsComponentOptions } from 'flarum/admin/components/AdminPage';\nimport Button from 'flarum/common/components/Button';\n\nexport class SettingsPage extends ExtensionPage {\n content(vnode: Mithril.VnodeDOM): JSX.Element {\n const settings = app.extensionData.getSettings(this.extension.id);\n\n const flarumSettings = this.flarumClientSettings(1);\n\n return (\n
\n
\n
\n
\n {this.buildSettingComponent({\n type: 'checkbox',\n label: 'Provider mode',\n setting: 'maicol07-sso.provider_mode',\n help: app.translator.trans('maicol07-sso.admin.settings.provider_mode'),\n className: 'maicol07-sso--provider-mode',\n })}\n \n
\n\n \n\n
{this.submitButton()}
\n
\n
\n
\n );\n }\n\n oncreate(vnode: Mithril.VnodeDOM) {\n super.oncreate(vnode);\n this.setting('maicol07-sso.provider_mode').map(() => m.redraw());\n }\n\n addRow() {\n const next = this.clientRows().length + 1;\n app.data.settings[`maicol07-sso.client${next}_url`] = '';\n }\n\n clientRows() {\n const clientRows = [];\n\n let i = 1;\n while (`maicol07-sso.client${i}_url` in app.data.settings) {\n clientRows.push(\n \n {this.flarumClientSettings(i).map((setting) => {\n setting.label = undefined;\n setting.help = undefined;\n return {this.buildSettingComponent(setting)};\n })}\n \n );\n i++;\n }\n\n return clientRows;\n }\n\n flarumClientSettings(clientNumber: number): SettingsComponentOptions[] {\n return [\n {\n setting: `maicol07-sso.client${clientNumber}_name`,\n type: 'text',\n label: app.translator.trans('maicol07-sso.admin.settings.client_name'),\n help: app.translator.trans('maicol07-sso.admin.settings.client_name_help'),\n },\n {\n setting: `maicol07-sso.client${clientNumber}_url`,\n type: 'text',\n label: app.translator.trans('maicol07-sso.admin.settings.client_url'),\n help: app.translator.trans('maicol07-sso.admin.settings.client_url_help'),\n },\n {\n setting: `maicol07-sso.client${clientNumber}_api_key`,\n type: 'password',\n label: app.translator.trans('maicol07-sso.admin.settings.client_api_key'),\n help: app.translator.trans('maicol07-sso.admin.settings.client_api_key_help'),\n },\n {\n setting: `maicol07-sso.client${clientNumber}_password_token`,\n type: 'password',\n label: app.translator.trans('maicol07-sso.admin.settings.client_password_token'),\n help: app.translator.trans('maicol07-sso.admin.settings.client_password_token_help'),\n },\n {\n setting: `maicol07-sso.client${clientNumber}_verify_ssl`,\n type: 'checkbox',\n label: app.translator.trans('maicol07-sso.admin.settings.client_verify_ssl'),\n help: app.translator.trans('maicol07-sso.admin.settings.client_verify_ssl_help'),\n },\n ];\n }\n\n generalClientSettings(): SettingsComponentOptions[] {\n return [\n {\n setting: 'maicol07-sso.login_url',\n label: app.translator.trans('maicol07-sso.admin.settings.login_url'),\n type: 'url',\n },\n {\n setting: 'maicol07-sso.signup_url',\n label: app.translator.trans('maicol07-sso.admin.settings.signup_url'),\n type: 'url',\n },\n {\n setting: 'maicol07-sso.logout_url',\n label: app.translator.trans('maicol07-sso.admin.settings.logout_url'),\n type: 'url',\n },\n {\n setting: 'maicol07-sso.manage_account_url',\n label: app.translator.trans('maicol07-sso.admin.settings.manage_account_url'),\n type: 'url',\n },\n {\n setting: 'maicol07-sso.cookies_prefix',\n label: app.translator.trans('maicol07-sso.admin.settings.cookies_prefix'),\n type: 'text',\n },\n ];\n }\n\n jwtSettings(): SettingsComponentOptions[] {\n return [\n {\n setting: 'maicol07-sso.jwt_iss',\n label: app.translator.trans('maicol07-sso.admin.settings.jwt_iss'),\n type: 'text',\n },\n {\n setting: 'maicol07-sso.jwt_signing_algorithm',\n label: app.translator.trans('maicol07-sso.admin.settings.jwt_signing_algorithm'),\n type: 'select',\n options: {\n Sha256: 'Sha256',\n Sha384: 'Sha384',\n Sha512: 'Sha512',\n },\n default: 'Sha256',\n },\n {\n setting: 'maicol07-sso.jwt_signer_key',\n label: app.translator.trans('maicol07-sso.admin.settings.jwt_signer_key'),\n type: 'text',\n },\n ];\n }\n\n booleanSetting(setting: string): boolean {\n return Boolean(Number(this.setting(`maicol07-sso.${setting}`)()));\n }\n}\n","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","import app from 'flarum/admin/app';\nimport { SettingsPage } from './SettingsPage';\n\napp.initializers.add('maicol07-sso', () => {\n app.extensionData\n .for('maicol07-sso')\n .registerSetting({\n setting: 'maicol07-sso.manage_account_btn_open_in_new_tab',\n label: app.translator.trans('maicol07-sso.admin.settings.manage_account_btn_open_in_new_tab'),\n type: 'boolean',\n })\n .registerSetting({\n setting: 'maicol07-sso.remove_login_btn',\n label: app.translator.trans('maicol07-sso.admin.settings.remove_login_btn'),\n type: 'boolean',\n })\n .registerSetting({\n setting: 'maicol07-sso.remove_signup_btn',\n label: app.translator.trans('maicol07-sso.admin.settings.remove_signup_btn'),\n type: 'boolean',\n })\n .registerPage(SettingsPage);\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","SettingsPage","_ExtensionPage","subClass","superClass","apply","arguments","create","constructor","_proto","content","vnode","settings","app","this","extension","id","flarumSettings","flarumClientSettings","m","className","buildSettingComponent","type","label","setting","help","hidden","booleanSetting","map","style","fontWeight","clientRows","Button","icon","onclick","addRow","generalClientSettings","jwtSettings","submitButton","oncreate","redraw","next","length","_this","i","push","undefined","clientNumber","options","Sha256","Sha384","Sha512","default","Boolean","Number","ExtensionPage","registerSetting","registerPage"],"sourceRoot":""} \ No newline at end of file diff --git a/js/dist/forum.js.map b/js/dist/forum.js.map index 923bfc1..6c21067 100644 --- a/js/dist/forum.js.map +++ b/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAA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F,EAAMf,UACrB,OAEFa,EAAQK,WACNH,EAAMf,SACN,OAAGS,KAAMM,EAAMhB,IAAKoB,UAAU,uBAC3BJ,EAAMb,MAGZ,CAEJ,CAEJ,KAEDS,EAAAA,EAAAA,QAAOS,IAAAA,UAAwB,gBAAgB,SAACd,IAC1CjB,EAAQ,gBAAiBK,UAAaL,EAAQ,eAKlDiB,EAAMU,OAAO,eACbV,EAAMU,OAAO,kBAER3B,EAAQ,qBAAsBK,UAInCY,EAAMe,IACJ,gBACA,OAAGC,MAAM,SAASb,KAAMpB,EAAQ,sBAAuBkC,OAAQlC,EAAQ,qCAAsCK,SAAW,SAAW,IAChIF,IAAAA,WAAAA,MAAqB,2CAG3B,KAEDmB,EAAAA,EAAAA,QAAOS,IAAAA,UAAwB,iBAAiB,SAACd,GAC3CjB,EAAQ,qBAAsBK,UAAYL,EAAQ,gBAAiBK,UAKnEY,EAAMW,IAAI,YAAuD,IAAzCX,EAAM7B,IAAI,WAAW+C,SAASC,QACxDnB,EAAMU,OAAO,UAEhB,GACF,G","sources":["webpack://@maicol07/flarum-ext-sso/webpack/bootstrap","webpack://@maicol07/flarum-ext-sso/webpack/runtime/compat get default export","webpack://@maicol07/flarum-ext-sso/webpack/runtime/define property getters","webpack://@maicol07/flarum-ext-sso/webpack/runtime/hasOwnProperty shorthand","webpack://@maicol07/flarum-ext-sso/webpack/runtime/make namespace object","webpack://@maicol07/flarum-ext-sso/external root \"flarum.core.compat['common/extend']\"","webpack://@maicol07/flarum-ext-sso/external root \"flarum.core.compat['forum/app']\"","webpack://@maicol07/flarum-ext-sso/external root \"flarum.core.compat['forum/components/HeaderSecondary']\"","webpack://@maicol07/flarum-ext-sso/external root \"flarum.core.compat['forum/components/SettingsPage']\"","webpack://@maicol07/flarum-ext-sso/external root \"flarum.core.compat['forum/components/LogInModal']\"","webpack://@maicol07/flarum-ext-sso/./src/forum/index.tsx"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/HeaderSecondary'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/SettingsPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/LogInModal'];","import { extend, override } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport HeaderSecondary from 'flarum/forum/components/HeaderSecondary';\nimport SettingsPage from 'flarum/forum/components/SettingsPage';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport { NestedStringArray } from '@askvortsov/rich-icu-message-formatter';\n\n/**\n * Returns a setting added by the extension\n */\nfunction setting(slug: string, cast?: typeof Boolean | typeof Number): any | boolean | number {\n let setting = app.forum.attribute(`maicol07-sso.${slug}`);\n\n if (cast !== undefined) {\n if (cast === Boolean && !isNaN(setting as number)) {\n setting = Number(setting);\n }\n return cast(setting);\n }\n\n return setting;\n}\n\n/**\n * Returns login and signup props\n */\nfunction getItems(): Record {\n return {\n login: {\n url: setting('login_url'),\n itemName: 'logIn',\n removeItem: setting('remove_login_btn', Boolean),\n text: app.translator.trans('core.forum.header.log_in_link'),\n },\n signup: {\n url: setting('signup_url'),\n itemName: 'signUp',\n removeItem: setting('remove_signup_btn', Boolean),\n text: app.translator.trans('core.forum.header.sign_up_link'),\n },\n };\n}\n\napp.initializers.add('maicol07-sso', () => {\n override(LogInModal.prototype, 'oncreate', () => {\n if (!setting('provider_mode', Boolean)) {\n const items = getItems();\n window.location.href = items.login.url;\n throw new Error('Stop execution');\n }\n });\n\n extend(HeaderSecondary.prototype, 'items', (buttons) => {\n if (!setting('provider_mode', Boolean)) {\n const items = getItems();\n for (const [, props] of Object.entries(items)) {\n if (props.url) {\n if (props.removeItem) {\n buttons.remove(props.itemName);\n } else {\n // Remove login button\n if (!buttons.has(props.itemName)) {\n return;\n }\n buttons.setContent(\n props.itemName,\n \n {props.text}\n \n );\n }\n }\n }\n }\n });\n\n extend(SettingsPage.prototype, 'accountItems', (items) => {\n if (setting('provider_mode', Boolean) || !setting('login_url')) {\n return; // Do not add account items if no login url is set.\n }\n\n // Remove change email and password buttons\n items.remove('changeEmail');\n items.remove('changePassword');\n\n if (!setting('manage_account_url', Boolean)) {\n return;\n }\n\n items.add(\n 'manageAccount',\n \n {app.translator.trans('maicol07-sso.forum.manage_account_btn')}\n \n );\n });\n\n extend(SettingsPage.prototype, 'settingsItems', (items) => {\n if (setting('manage_account_url', Boolean) || setting('provider_mode', Boolean)) {\n return; // Manage account link is added above\n }\n\n // Remove account section\n if (items.has('account') && items.get('account').children.length === 0) {\n items.remove('account');\n }\n });\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","setting","slug","cast","app","undefined","Boolean","isNaN","Number","getItems","login","url","itemName","removeItem","text","signup","override","LogInModal","items","window","location","href","Error","extend","HeaderSecondary","buttons","entries","props","remove","has","setContent","className","SettingsPage","add","class","target","children","length"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,+BCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,iBCAlD,EAA+BF,OAAOC,KAAKC,OAAO,a,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,oC,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,iC,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,+B,aCUxD,SAASC,EAAQC,EAAcC,GAC7B,IAAIF,EAAUG,IAAAA,MAAAA,UAAoB,gBAAgBF,GAElD,YAAaG,IAATF,GACEA,IAASG,SAAYC,MAAMN,KAC7BA,EAAUO,OAAOP,IAEZE,EAAKF,IAGPA,CACT,CAKA,SAASQ,IACP,MAAO,CACLC,MAAO,CACLC,IAAKV,EAAQ,aACbW,SAAU,QACVC,WAAYZ,EAAQ,mBAAoBK,SACxCQ,KAAMV,IAAAA,WAAAA,MAAqB,kCAE7BW,OAAQ,CACNJ,IAAKV,EAAQ,cACb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AuD,IAAzCd,EAAM7B,IAAI,WAAWmD,SAASX,QACxDX,EAAMa,OAAO,UAEjB,GACF,G","sources":["webpack://@maicol07/flarum-ext-sso/webpack/bootstrap","webpack://@maicol07/flarum-ext-sso/webpack/runtime/compat get default export","webpack://@maicol07/flarum-ext-sso/webpack/runtime/define property getters","webpack://@maicol07/flarum-ext-sso/webpack/runtime/hasOwnProperty shorthand","webpack://@maicol07/flarum-ext-sso/webpack/runtime/make namespace object","webpack://@maicol07/flarum-ext-sso/external root \"flarum.core.compat['common/extend']\"","webpack://@maicol07/flarum-ext-sso/external root \"flarum.core.compat['forum/app']\"","webpack://@maicol07/flarum-ext-sso/external root \"flarum.core.compat['forum/components/HeaderSecondary']\"","webpack://@maicol07/flarum-ext-sso/external root \"flarum.core.compat['forum/components/SettingsPage']\"","webpack://@maicol07/flarum-ext-sso/external root \"flarum.core.compat['forum/components/LogInModal']\"","webpack://@maicol07/flarum-ext-sso/./src/forum/index.tsx"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/HeaderSecondary'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/SettingsPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/LogInModal'];","import { extend, override } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport HeaderSecondary from 'flarum/forum/components/HeaderSecondary';\nimport SettingsPage from 'flarum/forum/components/SettingsPage';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport { NestedStringArray } from '@askvortsov/rich-icu-message-formatter';\n\n/**\n * Returns a setting added by the extension\n */\nfunction setting(slug: string, cast?: typeof Boolean | typeof Number): any | boolean | number {\n let setting = app.forum.attribute(`maicol07-sso.${slug}`);\n\n if (cast !== undefined) {\n if (cast === Boolean && !isNaN(setting as number)) {\n setting = Number(setting);\n }\n return cast(setting);\n }\n\n return setting;\n}\n\n/**\n * Returns login and signup props\n */\nfunction getItems(): Record {\n return {\n login: {\n url: setting('login_url'),\n itemName: 'logIn',\n removeItem: setting('remove_login_btn', Boolean),\n text: app.translator.trans('core.forum.header.log_in_link'),\n },\n signup: {\n url: setting('signup_url'),\n itemName: 'signUp',\n removeItem: setting('remove_signup_btn', Boolean),\n text: app.translator.trans('core.forum.header.sign_up_link'),\n },\n };\n}\n\napp.initializers.add('maicol07-sso', () => {\n override(LogInModal.prototype, 'oncreate', () => {\n if (!setting('provider_mode', Boolean)) {\n const items = getItems();\n window.location.href = items.login.url;\n throw new Error('Stop execution');\n }\n });\n\n extend(HeaderSecondary.prototype, 'items', (buttons) => {\n if (!setting('provider_mode', Boolean)) {\n const items = getItems();\n for (const [, props] of Object.entries(items)) {\n if (props.url) {\n if (props.removeItem) {\n buttons.remove(props.itemName);\n } else {\n // Remove login button\n if (!buttons.has(props.itemName)) {\n return;\n }\n buttons.setContent(\n props.itemName,\n \n {props.text}\n \n );\n }\n }\n }\n }\n });\n\n extend(SettingsPage.prototype, 'accountItems', (items) => {\n if (setting('provider_mode', Boolean) || !setting('login_url')) {\n return; // Do not add account items if no login url is set.\n }\n\n // Remove change email and password buttons\n items.remove('changeEmail');\n items.remove('changePassword');\n\n if (!setting('manage_account_url', Boolean)) {\n return;\n }\n\n items.add(\n 'manageAccount',\n \n {app.translator.trans('maicol07-sso.forum.manage_account_btn')}\n \n );\n });\n\n extend(SettingsPage.prototype, 'settingsItems', (items) => {\n if (setting('manage_account_url', Boolean) || setting('provider_mode', Boolean)) {\n return; // Manage account link is added above\n }\n\n // Remove account section\n if (items.has('account') && items.get('account').children.length === 0) {\n items.remove('account');\n }\n });\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","setting","slug","cast","app","undefined","Boolean","isNaN","Number","getItems","login","url","itemName","removeItem","text","signup","override","LogInModal","items","window","location","href","Error","extend","HeaderSecondary","buttons","_i","_Object$entries","entries","length","props","remove","has","setContent","m","className","SettingsPage","add","class","target","children"],"sourceRoot":""} \ No newline at end of file