summaryrefslogtreecommitdiffstats
path: root/templates/user/auth
diff options
context:
space:
mode:
authorJonas Franz <info@jonasfranz.software>2019-03-08 17:42:50 +0100
committertechknowlogick <matti@mdranta.net>2019-03-08 11:42:50 -0500
commite777c6bdc6f12f9152335f8bfd66b956aedc9957 (patch)
treeb79c9bc2d4f9402dcd15d993b088840e2fad8a54 /templates/user/auth
parent9d3732dfd512273992855097bba1e909f098db23 (diff)
downloadgitea-e777c6bdc6f12f9152335f8bfd66b956aedc9957.tar.gz
gitea-e777c6bdc6f12f9152335f8bfd66b956aedc9957.zip
Integrate OAuth2 Provider (#5378)
Diffstat (limited to 'templates/user/auth')
-rw-r--r--templates/user/auth/grant.tmpl31
-rw-r--r--templates/user/auth/grant_error.tmpl16
2 files changed, 47 insertions, 0 deletions
diff --git a/templates/user/auth/grant.tmpl b/templates/user/auth/grant.tmpl
new file mode 100644
index 0000000000..85c507a74a
--- /dev/null
+++ b/templates/user/auth/grant.tmpl
@@ -0,0 +1,31 @@
+{{template "base/head" .}}
+<div class="ui one column stackable center aligned page grid oauth2-authorize-application-box">
+ <div class="column seven wide">
+ <div class="ui middle centered raised segments">
+ <h3 class="ui top attached header">
+ {{.i18n.Tr "auth.authorize_title" .Application.Name}}
+ </h3>
+ <div class="ui attached segment">
+ {{template "base/alert" .}}
+ <p>
+ <b>{{.i18n.Tr "auth.authorize_application_description"}}</b><br/>
+ {{.i18n.Tr "auth.authorize_application_created_by" .ApplicationUserLink | Str2html}}
+ </p>
+ </div>
+ <div class="ui attached segment">
+ <p>{{.i18n.Tr "auth.authroize_redirect_notice" .ApplicationRedirectDomainHTML | Str2html}}</p>
+ </div>
+ <div class="ui attached segment">
+ <form method="post" action="{{.AppSubUrl}}/login/oauth/grant">
+ {{.CsrfTokenHtml}}
+ <input type="hidden" name="client_id" value="{{.Application.ClientID}}">
+ <input type="hidden" name="state" value="{{.State}}">
+ <input type="hidden" name="redirect_uri" value="{{.RedirectURI}}">
+ <input type="submit" id="authorize-app" value="{{.i18n.Tr "auth.authorize_application"}}" class="ui red inline button"/>
+ <a href="{{.RedirectURI}}" class="ui basic primary inline button">Cancel</a>
+ </form>
+ </div>
+ </div>
+ </div>
+</div>
+{{template "base/footer" .}}
diff --git a/templates/user/auth/grant_error.tmpl b/templates/user/auth/grant_error.tmpl
new file mode 100644
index 0000000000..0eb175fbe2
--- /dev/null
+++ b/templates/user/auth/grant_error.tmpl
@@ -0,0 +1,16 @@
+{{template "base/head" .}}
+{{if .IsRepo}}<div class="repository">{{template "repo/header" .}}</div>{{end}}
+<div class="ui one column stackable center aligned page grid oauth2-authorize-application-box">
+ <div class="column seven wide">
+ <div class="ui middle centered raised segments">
+ <h1 class="ui top attached header">
+ {{.i18n.Tr "auth.authorization_failed" }}
+ </h1>
+ <h3 class="ui attached segment">{{.Error.ErrorDescription}}</h3>
+ <div class="ui attached segment">
+ <p>{{.i18n.Tr "auth.authorization_failed_desc"}}</p>
+ </div>
+ </div>
+ </div>
+</div>
+{{template "base/footer" .}}