mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-11-30 20:31:09 +00:00
[bugfix] fix oob token route, update templates+css for oob and errors (#1519)
This commit is contained in:
parent
83d8a44020
commit
59b2e10787
4 changed files with 29 additions and 22 deletions
|
@ -53,7 +53,7 @@ const (
|
||||||
// OOBURI is the out-of-band oauth token uri
|
// OOBURI is the out-of-band oauth token uri
|
||||||
OOBURI = "urn:ietf:wg:oauth:2.0:oob"
|
OOBURI = "urn:ietf:wg:oauth:2.0:oob"
|
||||||
// OOBTokenPath is the path to redirect out-of-band token requests to.
|
// OOBTokenPath is the path to redirect out-of-band token requests to.
|
||||||
OOBTokenPath = "/oob"
|
OOBTokenPath = "/oauth/oob" // #nosec G101 else we get a hardcoded credentials warning
|
||||||
// HelpfulAdvice is a handy hint to users;
|
// HelpfulAdvice is a handy hint to users;
|
||||||
// particularly important during the login flow
|
// particularly important during the login flow
|
||||||
HelpfulAdvice = "If you arrived at this error during a login/oauth flow, please try clearing your session cookies and logging in again; if problems persist, make sure you're using the correct credentials"
|
HelpfulAdvice = "If you arrived at this error during a login/oauth flow, please try clearing your session cookies and logging in again; if problems persist, make sure you're using the correct credentials"
|
||||||
|
|
|
@ -277,19 +277,11 @@ section.login {
|
||||||
|
|
||||||
section.error {
|
section.error {
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
margin-bottom: 0.5rem;
|
margin-bottom: 0.5rem;
|
||||||
|
|
||||||
span {
|
|
||||||
font-size: 2em;
|
|
||||||
}
|
|
||||||
|
|
||||||
pre {
|
pre {
|
||||||
border: 1px solid #ff000080;
|
border: 1px solid #ff000080;
|
||||||
margin-left: 1em;
|
padding: 0.5rem;
|
||||||
padding: 0 0.7em;
|
|
||||||
border-radius: 0.5em;
|
border-radius: 0.5em;
|
||||||
background-color: #ff000010;
|
background-color: #ff000010;
|
||||||
font-size: 1.3em;
|
font-size: 1.3em;
|
||||||
|
@ -297,6 +289,15 @@ section.error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
section.oob-token {
|
||||||
|
code {
|
||||||
|
background: $gray1;
|
||||||
|
padding: 0.5rem;
|
||||||
|
margin: 0;
|
||||||
|
border-radius: 0.3rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.error-text {
|
.error-text {
|
||||||
color: $error1;
|
color: $error1;
|
||||||
background: $error2;
|
background: $error2;
|
||||||
|
|
|
@ -17,10 +17,15 @@
|
||||||
*/ -}}
|
*/ -}}
|
||||||
|
|
||||||
{{ template "header.tmpl" .}}
|
{{ template "header.tmpl" .}}
|
||||||
<main>
|
<main>
|
||||||
<section class="error">
|
<section class="error">
|
||||||
<span>❌</span> <pre>{{.error}}</pre>
|
<h1>An error occured:</h1>
|
||||||
<span>Request ID</span> <code>{{.requestID}}</code>
|
<pre>{{.error}}</pre>
|
||||||
</section>
|
{{if .requestID}}
|
||||||
</main>
|
<div>
|
||||||
|
<span>Request ID:</span> <code>{{.requestID}}</code>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
{{ template "footer.tmpl" .}}
|
{{ template "footer.tmpl" .}}
|
|
@ -17,10 +17,11 @@
|
||||||
*/ -}}
|
*/ -}}
|
||||||
|
|
||||||
{{ template "header.tmpl" .}}
|
{{ template "header.tmpl" .}}
|
||||||
<main>
|
<main>
|
||||||
<h1>Hi {{ .user }}!</h1>
|
<section class="oob-token">
|
||||||
<p>Here's your out-of-band token with scope <em>{{.scope}}</em>:</p>
|
<h1>Hi {{ .user }}!</h1>
|
||||||
<p><code>{{ .oobToken }}</code><p>
|
<p>Here's your out-of-band token with scope "<em>{{.scope}}</em>", use it wisely:</p>
|
||||||
<p>Use it wisely!</p>
|
<code>{{ .oobToken }}</code>
|
||||||
</main>
|
</section>
|
||||||
|
</main>
|
||||||
{{ template "footer.tmpl" .}}
|
{{ template "footer.tmpl" .}}
|
Loading…
Reference in a new issue