From 7067581f4407f9b5d78ce6d5c19ad94a0d42febf Mon Sep 17 00:00:00 2001 From: FoskyM Date: Sun, 1 Oct 2023 17:30:18 +0800 Subject: [PATCH] feat: get client info --- js/dist/forum.js | Bin 3225 -> 3312 bytes js/dist/forum.js.map | Bin 11465 -> 11744 bytes .../forum/components/oauth/AuthorizePage.js | 8 ++++++ src/Api/Controller/ShowClientController.php | 27 ++++++++++++++++++ 4 files changed, 35 insertions(+) create mode 100644 src/Api/Controller/ShowClientController.php diff --git a/js/dist/forum.js b/js/dist/forum.js index 3003770dcb5e07faa49bcbfd297579fbb652810d..83ca55c8a94579841b3ea060fc329507292cae13 100644 GIT binary patch delta 255 zcmbO!`9X36BQsa2ZHZou2`HZELS2Jq?$!pBIK$3+;8%P?kr~t`O76l+# z#-au!=dys*oB)%b!K56kK2XGu)rc{9awDt7kv-Cr8mXUoSZ)Gc~UyJ~Ks44JK5ST3nEySDYGO zQdy9SES!>Al$u-;Us{w|Qv)-vIJHDWNnc5`RwrK%$PURY$w{?ME6qzT$;{8w(5&8^ P&9RAzF=ewHcQqpb{11x^`HabvS2Jq?$!pBIK$3+;8%P?kr~t`O76l+# z#-au!=dys*oB)%b!K56kK2XGu)rhflawDt7DO?3p=p&dlU<`}>oR?V0RdUg2y57F96w_P8RL z3*ZUn0QmZK1oJe~027Y+8f7;QINJhP(&?8xRrj+uS|MlkQ!)-D zoK4aP4599`CP0&g97Ol=KX4D+*w{d`f;a*ec}d6qzWR_YXA<=_d%ZBQHCM1zDk6V| z2O~{~XO6m-yPX@DugFnuZq~yb`l<_>#P3ssKRcz(vNn!j)LWPo_6yD$)Si~0=h!`C zSbfSB(ag8p@!a@=I1JN#g(1mB~m}KWHgafXDW|Q-ranVKW9YM Tm(rCBe+d^@0XwK4rJuh6TO{i~ delta 521 zcmZWmO-lk%6vdU!2(Bz#6oS+ux?~0sE+p=|Zz_|~avG$VP(x2g2H+tg1V~OD%6dfxnjY`r-Y*g$9{WZB`Vy%~4fT|m4cbr{b6MA^vM%Zs zD>d*Dedr0K*3Lh;jpbov;#2@Jhj1ts&F-D4l(iJQR3&RB*O7)xu*n~>y>r9EUi2tR zb!*LAo#>R8>e?f^oaAiA9^AUP1Q%ktcT$#G-gD|W5E?759At{%O*v2bFhhFqkAG+Ep=p>xnSG?7pz zjw<*0YSM$4;TF_UGLv2roWS3okXlxc$xLc>Of&ywG)k7HNB22tt9MANZ}|KHV9bvp diff --git a/js/src/forum/components/oauth/AuthorizePage.js b/js/src/forum/components/oauth/AuthorizePage.js index e853bd6..30fd7a4 100644 --- a/js/src/forum/components/oauth/AuthorizePage.js +++ b/js/src/forum/components/oauth/AuthorizePage.js @@ -6,6 +6,7 @@ import LogInModal from 'flarum/forum/components/LogInModal'; import extractText from 'flarum/common/utils/extractText'; export default class AuthorizePage extends IndexPage { + params = []; oninit(vnode) { super.oninit(vnode); if (!app.session.user) { @@ -13,6 +14,13 @@ export default class AuthorizePage extends IndexPage { } const params = m.route.param(); + + if (params.client_id == null || params.response_type == null || params.redirect_uri == null) { + m.route.set('/'); + } else { + this.params = params; + + } } setTitle() { diff --git a/src/Api/Controller/ShowClientController.php b/src/Api/Controller/ShowClientController.php new file mode 100644 index 0000000..39adda5 --- /dev/null +++ b/src/Api/Controller/ShowClientController.php @@ -0,0 +1,27 @@ +getQueryParams(), 'id'); + RequestUtil::getActor($request)->assertUser(); + + $client = Client::findOrFail($id); + $client->client_secret = ''; + + return $client; + + } +}