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A,OAAAC,EAAAlD,MAAA,KAAAL,YAAA,KAAAT,EAAA+D,EAAAC,GAAA,IAAA/B,EAAA8B,EAAA7E,UAUhC,OAVgC+C,EACjCC,OAAA,SAAOC,GACL6B,EAAA9E,UAAMgD,OAAM9C,KAAC,KAAA+C,GACbY,KAAKkB,SAASvB,EAAEC,MAAMC,MAAM,YAC9B,EAACX,EACDiC,QAAA,WACE,OACExB,EAAA,OAAKmB,UAAU,kBAGnB,EAACE,CAAA,CAVgC,CAASI,KCK5C9B,IAAAA,aAAiBT,IAAI,8BAA8B,WACjDS,IAAAA,OAAW,mBAAqB,CAC9B+B,KAAM,mBACNC,UAAWxC,GAGbQ,IAAAA,OAAW,mBAAqB,CAC9B+B,KAAM,0BACNC,UAAWN,IAEbO,EAAAA,EAAAA,QAAOH,IAAAA,UAAoB,YAAY,SAAUI,GAC3ClC,IAAAA,QAAYC,MAAQD,IAAAA,QAAYC,KAAKkC,OAASzB,KAAKT,KAAKkC,MAC1DD,EAAM3C,IACJ,aACA6C,IAAAA,UACE,CACEC,KAAMrC,IAAAA,MAAU,kBAAmB,CAAEsC,SAAU5B,KAAKT,KAAKqC,aACzDC,KAAM,uBAER,CACEvC,IAAAA,WAAesB,MAAM,sDAIxB,IAGP,GACF,G","sources":["webpack://@foskym/flarum-oauth-center/webpack/bootstrap","webpack://@foskym/flarum-oauth-center/webpack/runtime/compat get default export","webpack://@foskym/flarum-oauth-center/webpack/runtime/define property getters","webpack://@foskym/flarum-oauth-center/webpack/runtime/hasOwnProperty shorthand","webpack://@foskym/flarum-oauth-center/webpack/runtime/make namespace object","webpack://@foskym/flarum-oauth-center/external root \"flarum.core.compat['common/extenders']\"","webpack://@foskym/flarum-oauth-center/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@foskym/flarum-oauth-center/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@foskym/flarum-oauth-center/external root \"flarum.core.compat['common/Model']\"","webpack://@foskym/flarum-oauth-center/./src/common/models/Client.js","webpack://@foskym/flarum-oauth-center/./src/common/extend.js","webpack://@foskym/flarum-oauth-center/external root \"flarum.core.compat['forum/app']\"","webpack://@foskym/flarum-oauth-center/external root \"flarum.core.compat['common/extend']\"","webpack://@foskym/flarum-oauth-center/external root \"flarum.core.compat['forum/components/UserPage']\"","webpack://@foskym/flarum-oauth-center/external root \"flarum.core.compat['common/components/LinkButton']\"","webpack://@foskym/flarum-oauth-center/external root \"flarum.core.compat['common/components/Page']\"","webpack://@foskym/flarum-oauth-center/external root \"flarum.core.compat['forum/components/IndexPage']\"","webpack://@foskym/flarum-oauth-center/external root \"flarum.core.compat['forum/components/LogInModal']\"","webpack://@foskym/flarum-oauth-center/external root \"flarum.core.compat['common/utils/extractText']\"","webpack://@foskym/flarum-oauth-center/./src/forum/components/oauth/AuthorizePage.js","webpack://@foskym/flarum-oauth-center/./src/forum/components/user/AuthorizedPage.js","webpack://@foskym/flarum-oauth-center/./src/forum/index.js"],"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/extenders'];","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}","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}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","import Model from 'flarum/common/Model';\n\nexport default class Client extends Model {\n client_id = Model.attribute('client_id');\n client_secret = Model.attribute('client_secret');\n redirect_uri = Model.attribute('redirect_uri');\n grant_types = Model.attribute('grant_types');\n scope = Model.attribute('scope');\n user_id = Model.attribute('user_id');\n client_name = Model.attribute('client_name');\n client_icon = Model.attribute('client_icon');\n client_desc = Model.attribute('client_desc');\n client_home = Model.attribute('client_home');\n}\n","import Extend from 'flarum/common/extenders';\nimport Client from \"./models/Client\";\n\nexport default [\n new Extend.Store()\n .add('oauth-clients', Client),\n];\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/UserPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Page'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/IndexPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/LogInModal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extractText'];","import app from 'flarum/forum/app';\nimport {extend} from 'flarum/common/extend';\nimport Page from 'flarum/common/components/Page';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport extractText from 'flarum/common/utils/extractText';\n\nexport default class AuthorizePage extends IndexPage {\n params = [];\n client = null;\n oninit(vnode) {\n super.oninit(vnode);\n if (!app.session.user) {\n setTimeout(() => app.modal.show(LogInModal), 500);\n }\n\n const params = m.route.param();\n\n if (params.client_id == null || params.response_type == null || params.redirect_uri == null) {\n m.route.set('/');\n } else {\n this.params = params;\n app.store.find('oauth-clients', params.client_id).then(client => {\n if (client.length === 0) {\n m.route.set('/');\n } else {\n this.client = client[0];\n const uris = client.redirect_uri.split(' ');\n console.log(uris);\n if (app.forum.attribute('foskym-oauth-center.require_exact_redirect_uri') && uris.indexOf(params.redirect_uri) == -1) {\n m.route.set('/');\n }\n if (app.forum.attribute('foskym-oauth-center.allow_implicit') && params.response_type == 'token') {\n m.route.set('/');\n }\n if (app.forum.attribute('foskym-oauth-center.enforce_state') && params.enforce_state == null) {\n m.route.set('/');\n }\n }\n });\n }\n }\n\n setTitle() {\n app.setTitle(extractText(app.translator.trans('foskym-oauth-center.forum.page.title.authorize')));\n app.setTitleCount(0);\n }\n view() {\n if (!this.client) {\n return '';\n }\n app.setTitle(extractText(app.translator.trans('foskym-oauth-center.forum.page.title.authorize') + ' ' + this.client.client_name));\n app.setTitleCount(0);\n return (\n <div className=\"AuthorizePage\">\n <div className=\"container\">\n </div>\n </div>\n );\n }\n}\n","import UserPage from 'flarum/forum/components/UserPage';\nexport default class AuthorizedPage extends UserPage {\n oninit(vnode) {\n super.oninit(vnode);\n this.loadUser(m.route.param('username'));\n }\n content() {\n return (\n <div className=\"AuthorizedPage\">\n </div>\n );\n }\n}\n","import app from 'flarum/forum/app';\nimport {extend} from 'flarum/common/extend';\nimport UserPage from 'flarum/forum/components/UserPage';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport AuthorizePage from \"./components/oauth/AuthorizePage\";\nimport AuthorizedPage from \"./components/user/AuthorizedPage\";\napp.initializers.add('foskym/flarum-oauth-center', () => {\n app.routes['oauth.authorize'] = {\n path: '/oauth/authorize',\n component: AuthorizePage\n };\n\n app.routes['user.authorized'] = {\n path: '/u/:username/authorized',\n component: AuthorizedPage\n };\n extend(UserPage.prototype, 'navItems', function (items) {\n if (app.session.user && app.session.user.id() === this.user.id()) {\n items.add(\n 'authorized',\n LinkButton.component(\n {\n href: app.route('user.authorized', { username: this.user.username() }),\n icon: 'fas fa-user-friends',\n },\n [\n app.translator.trans('foskym-oauth-center.forum.page.label.authorized'),\n // this.user.moderatorNoteCount() > 0 ? <span className=\"Button-badge\">{this.user.moderatorNoteCount()}</span> : '',\n ]\n ),\n -110\n );\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","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","_inheritsLoose","subClass","superClass","create","constructor","Client","_Model","_this","_len","arguments","length","args","Array","_key","apply","concat","client_id","Model","client_secret","redirect_uri","grant_types","scope","user_id","client_name","client_icon","client_desc","client_home","Extend","add","AuthorizePage","_IndexPage","params","client","_proto","oninit","vnode","_this2","app","user","setTimeout","show","LogInModal","m","route","param","response_type","set","this","find","then","uris","split","console","log","attribute","indexOf","enforce_state","setTitle","extractText","trans","view","className","IndexPage","AuthorizedPage","_UserPage","loadUser","content","UserPage","path","component","extend","items","id","LinkButton","href","username","icon"],"sourceRoot":""} |