mention pre-filling on the oauth token form

pull/8063/head
Thibault Duplessis 2021-01-31 23:10:18 +01:00
parent 1f43416c58
commit d50262c6b7
1 changed files with 22 additions and 3 deletions

View File

@ -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."
)
)
}
)
)
)