Oauth/token (#7)

* add host and protocol options

* some fiddling

* tidying up and comments

* tick off /oauth/token

* tidying a bit

* tidying

* go mod tidy

* allow attaching middleware to server

* add middleware

* more user friendly

* add comments

* comments

* store account + app

* tidying

* lots of restructuring

* lint + tidy
This commit is contained in:
Tobi Smethurst
2021-03-22 22:26:54 +01:00
committed by GitHub
parent 4194f8d88f
commit aa9ce272dc
30 changed files with 1346 additions and 977 deletions

View File

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Auth</title>
<title>GoToSocial Authorization</title>
<link
rel="stylesheet"
href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"
@ -11,13 +11,13 @@
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>
{{if len .code | eq 0 }}
<body>
<div class="container">
<div class="jumbotron">
<form action="/oauth/authorize" method="POST">
<h1>Authorize</h1>
<p>The client would like to perform actions on your behalf.</p>
<h1>Hi {{.user}}!</h1>
<p>Application <b>{{.appname}}</b> {{if len .appwebsite | eq 0 | not}}({{.appwebsite}}) {{end}}would like to perform actions on your behalf, with scope <em>{{.scope}}</em>.</p>
<p>The application will redirect to {{.redirect}} to continue.</p>
<p>
<button
type="submit"
@ -31,14 +31,4 @@
</div>
</div>
</body>
{{else}}
<body>
<div class="container">
<div class="jumbotron">
{{.code}}
</div>
</div>
</body>
{{end}}
</html>