2024-02-20 15:58:43 -08:00
|
|
|
{{/* This template is used by application handlers to render allowing oauth2
|
|
|
|
|
links */}}
|
|
|
|
|
<!doctype html>
|
|
|
|
|
<html lang="en">
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="UTF-8" />
|
|
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
|
|
|
<title>Application {{.AppName}}</title>
|
|
|
|
|
<style>
|
|
|
|
|
* {
|
|
|
|
|
padding: 0;
|
|
|
|
|
margin: 0;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
html,
|
|
|
|
|
body {
|
|
|
|
|
background-color: #05060b;
|
|
|
|
|
color: #f7f9fd;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
font-family: sans-serif;
|
|
|
|
|
font-size: 16px;
|
2026-09-01 09:16:08 -07:00
|
|
|
/* A fixed height would let align-items: center push a long scope list
|
|
|
|
|
past both edges, leaving the top half unreachable by scrolling. */
|
|
|
|
|
min-height: 100%;
|
2024-02-20 15:58:43 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.container {
|
|
|
|
|
--side-padding: 24px;
|
|
|
|
|
width: 100%;
|
|
|
|
|
max-width: calc(320px + var(--side-padding) * 2);
|
|
|
|
|
padding: 0 var(--side-padding);
|
|
|
|
|
text-align: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.icons-container {
|
|
|
|
|
align-items: center;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
margin-bottom: 24px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.coder-svg,
|
|
|
|
|
.app-icon {
|
|
|
|
|
width: 80px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.connect-symbol {
|
|
|
|
|
font-size: 40px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
margin: 0 10px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
h1 {
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
font-size: 36px;
|
|
|
|
|
margin-bottom: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
p,
|
|
|
|
|
li {
|
|
|
|
|
color: #b2bfd7;
|
|
|
|
|
line-height: 140%;
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-27 23:26:17 +03:00
|
|
|
.user-name {
|
2024-02-20 15:58:43 -08:00
|
|
|
font-weight: bold;
|
|
|
|
|
}
|
|
|
|
|
|
2026-09-01 09:16:08 -07:00
|
|
|
#scope-list {
|
|
|
|
|
list-style: none;
|
|
|
|
|
margin-top: 12px;
|
|
|
|
|
/* The container centres its text, which would stagger the left edges. */
|
|
|
|
|
text-align: left;
|
|
|
|
|
padding-left: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#scope-disclaimer {
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
margin-top: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-20 15:58:43 -08:00
|
|
|
.button-group {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
gap: 12px;
|
|
|
|
|
margin-top: 24px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.button-group a,
|
|
|
|
|
.button-group button {
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
padding: 6px 16px;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
border: 1px solid #2c3854;
|
|
|
|
|
text-decoration: none;
|
|
|
|
|
background: none;
|
|
|
|
|
font-size: inherit;
|
|
|
|
|
color: inherit;
|
|
|
|
|
width: 200px;
|
|
|
|
|
height: 42px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.button-group a:hover,
|
|
|
|
|
.button-group button:hover {
|
|
|
|
|
border-color: hsl(222, 31%, 40%);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.button-group .primary-button {
|
|
|
|
|
background-color: #2c3854;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
<div class="container">
|
|
|
|
|
<div class="icons-container">
|
|
|
|
|
{{- if .AppIcon }}
|
|
|
|
|
<img class="app-icon" src="{{ .AppIcon }}" />
|
|
|
|
|
<div class="connect-symbol">+</div>
|
|
|
|
|
{{end}}
|
2025-10-06 12:14:35 -06:00
|
|
|
<img class="coder-svg" src="/icon/coder.svg" alt="Coder" />
|
2024-02-20 15:58:43 -08:00
|
|
|
</div>
|
|
|
|
|
<h1>Authorize {{ .AppName }}</h1>
|
2026-09-01 09:16:08 -07:00
|
|
|
{{- if not .Unrestricted }}
|
|
|
|
|
<p id="description">
|
|
|
|
|
Allow {{ .AppName }} to access your
|
|
|
|
|
<span class="user-name">{{ .Username }}</span> account with these
|
|
|
|
|
permissions?
|
|
|
|
|
</p>
|
|
|
|
|
{{- /* WebKit drops implicit list semantics when list-style is none,
|
|
|
|
|
leaving VoiceOver to announce the permissions as loose text. */}}
|
|
|
|
|
<ul id="scope-list" role="list">
|
|
|
|
|
{{- range .Scopes }}
|
|
|
|
|
<li role="listitem">{{ . }}</li>
|
|
|
|
|
{{- end }}
|
|
|
|
|
</ul>
|
|
|
|
|
{{- /* Scope identifiers read narrower than they grant: template:read
|
|
|
|
|
reaches every template in the deployment, not the one in play. */}}
|
|
|
|
|
<p id="scope-disclaimer">
|
|
|
|
|
These are technical permission names. Grant them only to an application
|
|
|
|
|
you trust.
|
|
|
|
|
</p>
|
|
|
|
|
{{- else }}
|
2026-04-27 23:26:17 +03:00
|
|
|
<p id="description">
|
2024-02-20 15:58:43 -08:00
|
|
|
Allow {{ .AppName }} to have full access to your
|
|
|
|
|
<span class="user-name">{{ .Username }}</span> account?
|
|
|
|
|
</p>
|
2026-09-01 09:16:08 -07:00
|
|
|
{{- end }}
|
2026-04-27 23:26:17 +03:00
|
|
|
<div class="button-group" id="button-group">
|
|
|
|
|
<form id="allow-form" method="POST" style="display: inline;">
|
2026-02-23 12:18:44 +01:00
|
|
|
<input type="hidden" name="csrf_token" value="{{ .CSRFToken }}" />
|
2025-07-01 15:39:29 +02:00
|
|
|
<button type="submit" class="primary-button">Allow</button>
|
|
|
|
|
</form>
|
2026-04-27 23:26:17 +03:00
|
|
|
<a id="cancel-link" href="{{ .CancelURI }}">Cancel</a>
|
2024-02-20 15:58:43 -08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-04-27 23:26:17 +03:00
|
|
|
<script>
|
|
|
|
|
(function () {
|
|
|
|
|
var appName = "{{ .AppName }}";
|
|
|
|
|
var description = document.getElementById("description");
|
|
|
|
|
var buttonGroup = document.getElementById("button-group");
|
|
|
|
|
var allowForm = document.getElementById("allow-form");
|
|
|
|
|
var cancelLink = document.getElementById("cancel-link");
|
2026-09-01 09:16:08 -07:00
|
|
|
var scopeList = document.getElementById("scope-list");
|
|
|
|
|
var scopeDisclaimer = document.getElementById("scope-disclaimer");
|
2026-04-27 23:26:17 +03:00
|
|
|
|
|
|
|
|
function showFeedback(message) {
|
|
|
|
|
buttonGroup.style.display = "none";
|
2026-09-01 09:16:08 -07:00
|
|
|
if (scopeList) {
|
|
|
|
|
scopeList.style.display = "none";
|
|
|
|
|
}
|
|
|
|
|
if (scopeDisclaimer) {
|
|
|
|
|
scopeDisclaimer.style.display = "none";
|
|
|
|
|
}
|
2026-04-27 23:26:17 +03:00
|
|
|
description.textContent = message;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
allowForm.addEventListener("submit", function (e) {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
showFeedback(
|
|
|
|
|
appName +
|
|
|
|
|
" is now authorized to access your account. This window can now be closed."
|
|
|
|
|
);
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
allowForm.submit();
|
|
|
|
|
}, 500);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
cancelLink.addEventListener("click", function (e) {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
showFeedback(
|
|
|
|
|
appName +
|
|
|
|
|
" was denied access to your account. This window can now be closed."
|
|
|
|
|
);
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
window.location.href = cancelLink.href;
|
|
|
|
|
}, 500);
|
|
|
|
|
});
|
|
|
|
|
})();
|
|
|
|
|
</script>
|
2024-02-20 15:58:43 -08:00
|
|
|
</body>
|
|
|
|
|
</html>
|