From 663828aaf76eb51bc472665b9e874d2649af4aa2 Mon Sep 17 00:00:00 2001 From: FoskyM Date: Sun, 1 Oct 2023 22:09:46 +0800 Subject: [PATCH] feat: authorize page --- js/dist/admin.js | Bin 10721 -> 10705 bytes js/dist/admin.js.map | Bin 32022 -> 32032 bytes js/dist/forum.js | Bin 6643 -> 7223 bytes js/dist/forum.js.map | Bin 21210 -> 23797 bytes .../forum/components/oauth/AuthorizePage.js | 292 +++++++++++------- less/admin.less | 4 + less/forum/oauth.less | 12 +- locale/zh-Hans.yml | 2 + 8 files changed, 200 insertions(+), 110 deletions(-) diff --git a/js/dist/admin.js b/js/dist/admin.js index 567e5fe6c2e417e61a445d06923c0cfa1bbc3e08..5ecd5a14bc40c5397206e56b141b0f8928da3af7 100644 GIT binary patch delta 92 zcmaDDd@*=K4cq1!Y_}vQ*DGkV7~0y}PF|&;Y?7Q`kXjs_7ps?99G{Y!mROooqM=cu fSBy93vwQ~H8IuYb5tCXVCzFLBBa=oU8V6%& gWn*h)WV7)g^a7K@8yE$1V{dR}li(X8vl1k~1+kzR(*OVf diff --git a/js/dist/admin.js.map b/js/dist/admin.js.map index b06d6b77fb19336f941646582caaae430f7ca68e..308bcfe179d1017762437e2a89f25eb068c1f66b 100644 GIT binary patch delta 668 zcmZ`$OK1~O6lI#vw1tQS5fd?)QYwvkwn+>5C_&zP8N(PPV`G}uQrl!QX{HJ3G?QQ= zmg3%pa6$YaxDz*i7;q)x!cCWMUAYmZAn3Lr_};^%ZtlHs&pYSb^Bx>Y&yJ+muY5BV zq+(n|WsGr;paN@R-X%!m^EFm%0-tm8W%rlcY4`jrU=GBDmEEAZGK9(VX2 zmv6v3|0y^ruN_k{P0|EGRg7yb0ypK;7du4fdU%0|CKO9;!iXqWql{mSCF=@IDzt5okTY_er^eDG;b&>K5wm1__6YDZhqQVOuKh@N`O( z7Ts@C3Gay&5eLc;j9Cg*c1phL#?QV8`pU+RZNlfwd-rAb;k2i|GlaXB6xUkc^TCEX z34>+`J~YSSiW!1~wE*my2y7!N)#1Kz!I#VBlq4J&=Vha18f~)yb~D28f!vzaZJ5LL zIm_8-n9bUt)1RH~w=8GQ;eyUT)-ffnBxA~qvJit`^(+(`Us>OWCzV6^x#@QwHHTg| X)qWfBa?kL6xasO6$-|s1-TC+jIZ@Jk delta 570 zcmX|-&ubG=5XV{5Y}-RUgi=btWP@O!KB7^KQHVHiHYrPyO-Pg2CQ8G0iK)`mxW*`g zKdy?P1I0_B9xGS_?<`&f{{j*5Xbe7wjb(Zs zdO6{?rEsCRMmaNMJfXm}COcAi04-UiEi*cCpX*S*Nng!b`9O*qKyz6*ppU39#;_;K z`kj_y9$1gLR{n#%*;${!C{MTq6My=N4*eqhDE^}C35(}8$ zK<$Qk?&auShyEo%8%HV8k^pUanJ2)m%!~*}_&lH{u(;0ta8_PK;i@0wgUI-!`Kq3@ zuU<#vA+ycqNPDpi{W_IQx?N=a2Gal)9b-?n3;fFpUwF*VMf6TehYUCjUb5*!tZ1Ox zi*21S&e50IByA>aBdvZX&W}xxcISw!o;Sp?1Lc3XasqG0te4HpxvQSbcSFukeI(SPqGeXpl!#}#UDw=hNf{YJR#bvAredps7> JO&d?Y9RTvjwPFAO diff --git a/js/dist/forum.js b/js/dist/forum.js index 125dc0075042fa35013b25c1216e2dcff7091fd9..4ee4e8b5f13846242eb843c7018a12a07036a300 100644 GIT binary patch delta 2252 zcmb7FJ!~9B6qfPD7n|5zV*6qz5S^EBnT_Yxb_gi!Y3&F_g36AF5kiS|+S{GG-FW|) znYDefPDf8UMJgZ#1yTx-D3AyRB_(O7=#VH

_a_H?zCPT@nh4eVUo~Gw*%x&9_hA z{Qlav6O%K{;zopg9XsNS>NydfI2I2kXC|0g1?!+!>l*onET!E9Fk1JRB;Irk5)> zmGZDq-Yt}x6NgD0k%+UkcT>*eNZV^3*tE8*9PaA)))3|OndR$QvCN9nAb`@Hzz5fs zLcqGc2PZ*nyMENQR@PwyK-nqxV(Q-`uC=m(iTJJhwiwK;PI%(s%v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XzqosawDlvEJ#^w31U%#9>|KqRUcAxEu;7lhpEqQu2acw?%jgrruPQ8CIb?!MlUVruN z8`GDPbFX6Y*Ns=+7xOz2l?KOBzTs>>02`|WqIFBdMJxt`{ z`$qegWvlXO{aTt6d0WHYVZSe?4S4pJ9L1Fv@u+_crAeb9oB1PJ;m{VmX6k!OnRWy9 z^ws2chlG?g*fKGLAW8u>yWAlZQsa2whyVuK*NT_KEq6sj2C& zCZ|&8CP8WP`L|P(Q`g^n?sge-PiA^^gR`9eE_W*2pEm8H3(n2ieKsFv6@3blzG%py zkZUKcYP!qTXDjl1WQQ-*-#O}ZgsTo58)@6u)79(f>57;KeU1LHB_^Jx0SsV&O<3vsmbf$A$`ho?y`H@f}{`4A6tS&MI7@FAi0}Jc4@Z@{K6~Ouby8%@Z!S1 z*}OeH^fWZX4*a*^zlr|XyfNFF=Cglly|{*`r*CyT6Hb5bDWTTh&nS54K{|J6e?I4J U(`|u%T$nH1LY@&nb@g5NA88x app.modal.show(LogInModal), 500); - } + oninit(vnode) { + super.oninit(vnode); + if (!app.session.user) { + setTimeout(() => app.modal.show(LogInModal), 500); + } - const params = m.route.param(); + const params = m.route.param(); - if (params.client_id == null || params.response_type == null || params.redirect_uri == null) { - m.route.set('/'); + if (params.client_id == null || params.response_type == null || params.redirect_uri == null) { + m.route.set('/'); + } else { + this.params = params; + app.store.find('oauth-clients', params.client_id).then(client => { + if (client.length === 0) { + m.route.set('/'); } else { - this.params = params; - app.store.find('oauth-clients', params.client_id).then(client => { - if (client.length === 0) { - m.route.set('/'); - } else { - this.client = client[0]; - let uris = null; - if (this.client.redirect_uri().indexOf(' ') > -1) { - uris = this.client.redirect_uri().split(' '); - } else { - uris = [this.client.redirect_uri()]; - } + this.client = client[0]; + let uris = null; + if (this.client.redirect_uri().indexOf(' ') > -1) { + uris = this.client.redirect_uri().split(' '); + } else { + uris = [this.client.redirect_uri()]; + } - if (app.forum.attribute('foskym-oauth-center.require_exact_redirect_uri') && uris.indexOf(params.redirect_uri) == -1) { - m.route.set('/'); - } - if (app.forum.attribute('foskym-oauth-center.allow_implicit') && params.response_type == 'token') { - m.route.set('/'); - } - if (app.forum.attribute('foskym-oauth-center.enforce_state') && params.enforce_state == null) { - m.route.set('/'); - } - } + if (app.forum.attribute('foskym-oauth-center.require_exact_redirect_uri') && uris.indexOf(params.redirect_uri) == -1) { + m.route.set('/'); + } + if (app.forum.attribute('foskym-oauth-center.allow_implicit') && params.response_type == 'token') { + m.route.set('/'); + } + if (app.forum.attribute('foskym-oauth-center.enforce_state') && params.enforce_state == null) { + m.route.set('/'); + } + + app.store.find('oauth-scopes').then((scopes) => { + this.scopes = scopes + let scope = params.scope; + + if (params.scope == null) { + scope = this.client.scope(); + } + + let scopes_temp = []; + if (scope == null) { + scopes_temp = []; + } else if (scope.indexOf(' ') > -1) { + scopes_temp = scope.split(' '); + } else { + scopes_temp = [scope]; + } + + let default_scopes = []; + this.scopes.map(scope => { + if (scope.is_default() === 1) { + default_scopes.push(scope); + } }); + + scopes_temp = scopes_temp.concat(default_scopes); + + this.client_scope = scopes_temp.filter((scope, index) => scopes_temp.indexOf(scope) === index); + console.log( this.client_scope ); + this.loading = false; + m.redraw(); + }); + + } + }); } + } - setTitle() { - app.setTitle(extractText(app.translator.trans('foskym-oauth-center.forum.page.title.authorize'))); - app.setTitleCount(0); + setTitle() { + app.setTitle(extractText(app.translator.trans('foskym-oauth-center.forum.page.title.authorize'))); + app.setTitleCount(0); + } + + view() { + if (!this.client) { + return ''; } + return ( + !this.loading &&

+
+
+
+
+

{app.forum.attribute('title')}

+

+ {app.translator.trans('foskym-oauth-center.forum.authorize.access')} {this.client.client_name()} +

- view() { - if (!this.client) { - return ''; - } - return ( -
-
-
-
-
-

{app.forum.attribute('title')}

-

- {app.translator.trans('foskym-oauth-center.forum.authorize.access')} {this.client.client_name()} -

+
+
-
-
- -
- - - - - -
-
-
-
- -
-
-
- 保持对已向 计量便民平台 授予访问权限的数据的访问权限
- - 即使当前没有使用该应用,也允许 计量便民平台 查看和更新你授予其访问权限的数据。这不会向 - 计量便民平台 授予任何其他权限。 -
-
-
-
- -
-
-
- 读取用户个人资料
- - 访问该用户(mouse123)的个人信息、最新动态等 -
-
-
-
- - - - - -
- - -
-
- - -
-
-
+
+ + + + +
+
+ { + this.client_scope.length > 0 && this.client_scope.map(scope => { + let scope_info = null; + this.scopes.map(s => { + if (s.scope() === scope.scope()) { + scope_info = s; + } + }); + if (scope_info == null) { + return ''; + } + return ( +
+
+ { + (scope_info.scope_icon().indexOf('fa-') > -1) ? + : + + } +
+
+
+ {scope_info.scope_name()} +
+ + { + scope_info.scope_desc() + .replace('{client_name}', this.client.client_name()) + .replace('{user}', app.session.user.attribute('displayName')) + } + +
+
+ ); + }) + } +
+
+{/* + + + + */} + +
+ + +
+
+ + +
- ); - } +
+
+
+ ); + } + + onsubmit(e) { + e.preventDefault(); + app.request({ + method: 'POST', + url: '/oauth/authorize', + body: { + response_type: this.params.response_type, + client_id: this.params.client_id, + redirect_uri: this.params.redirect_uri, + state: this.params.state, + scope: this.params.scope, + is_authorized: this.is_authorized, + } + }).then((r) => console.log(r)); + + // Some form handling logic here + } } diff --git a/less/admin.less b/less/admin.less index 7618a0e..8add5d6 100644 --- a/less/admin.less +++ b/less/admin.less @@ -42,6 +42,10 @@ } } + .Checkbox { + padding: 0 10px; + } + .FormControl { background: @body-bg; border-color: @control-bg; diff --git a/less/forum/oauth.less b/less/forum/oauth.less index b76de17..c85eea5 100644 --- a/less/forum/oauth.less +++ b/less/forum/oauth.less @@ -13,6 +13,8 @@ width: 376px; margin: 0 auto; box-sizing: border-box; + box-shadow: 0px 0px 15px 0px #bdbdbd; + border-radius: 12px; } .oauth-main::before { @@ -23,8 +25,8 @@ height: 100%; left: 0; top: 0; - box-shadow: 0 25px 50px #00000030; background: hsla(0, 0%, 100%, .3); + border-radius: 12px; } .oauth-box { @@ -36,6 +38,7 @@ backdrop-filter: blur(0); text-align: center; box-shadow: 0 5px 10px -5px #d2d2d2; + border-radius: 12px 12px 0 0; } .oauth-header h2 { @@ -51,6 +54,10 @@ color: #333; } +.oauth-body { + border-radius: 0 0 12px 12px; +} + .oauth-body .oauth-form-item { position: relative; margin-bottom: 15px; @@ -100,7 +107,7 @@ label:before { } .oauth-header { - background-color: #fff; + // background-color: #fff; } body { @@ -209,6 +216,7 @@ img.oauth-scope-object { margin-top: 0; font-weight: 800; color: #382e2e; + margin-block-end: 0; } .oauth-scope-body small { diff --git a/locale/zh-Hans.yml b/locale/zh-Hans.yml index e9a8d77..556fb1b 100644 --- a/locale/zh-Hans.yml +++ b/locale/zh-Hans.yml @@ -38,3 +38,5 @@ foskym-oauth-center: authorized: 授权记录 authorize: access: 授权访问 + agree: 授权 + deny: 拒绝