From d50262c6b7077d21c67c32084729cebfa030a900 Mon Sep 17 00:00:00 2001 From: Thibault Duplessis Date: Sun, 31 Jan 2021 23:10:18 +0100 Subject: [PATCH] mention pre-filling on the oauth token form --- app/views/oAuth/token/create.scala | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/app/views/oAuth/token/create.scala b/app/views/oAuth/token/create.scala index 9818ee8428..f914d0976a 100644 --- a/app/views/oAuth/token/create.scala +++ b/app/views/oAuth/token/create.scala @@ -1,13 +1,12 @@ package views.html.oAuth.token +import controllers.routes import play.api.data.Form import lila.api.Context import lila.app.templating.Environment._ import lila.app.ui.ScalatagsTemplate._ -import controllers.routes - object create { def apply(form: Form[lila.oauth.OAuthForm.token.Data], me: lila.user.User)(implicit ctx: Context) = { @@ -55,7 +54,27 @@ object create { form3.actions( a(href := routes.OAuthToken.index())("Cancel"), form3.submit(trans.apply()) - ) + ), + br, + div { + val url = + s"${netBaseUrl}${routes.OAuthToken.create()}?scopes[]=challenge:write&scopes[]=puzzle:read&description=Prefilled+token+example" + frag( + h2("Note for the attention of developers only:"), + p( + "It is possible to pre-fill this form by tweaking the query parameters of the URL.", + br, + "For example: ", + a(href := url)(url), + br, + "ticks the challenge:create and puzzle:read permissions, and sets the token description.", + br, + "The permission codes can be found in the HTML code of the form.", + br, + "Giving these pre-filled URLs to your users will help them get the right token permissions." + ) + ) + } ) ) )