vueify OIDC device views

This commit is contained in:
Johannes Zellner
2026-03-18 10:58:00 +01:00
parent e3d76ea9f4
commit 9633036887
10 changed files with 224 additions and 82 deletions
@@ -0,0 +1,73 @@
<script setup>
import PublicPageLayout from '../components/PublicPageLayout.vue';
// coming from oidc_device_confirm.html server-side rendered
const clientName = window.cloudron.clientName;
const userCode = window.cloudron.userCode;
const form = window.cloudron.form;
</script>
<template>
<PublicPageLayout>
<div style="max-width: 300px;">
<h2>Confirm Device</h2>
<p>
<strong>{{ clientName }}</strong>
<br/><br/>
The following code should be displayed on your device<br/><br/>
<code class="user-code">{{ userCode }}</code>
<br/><br/>
<small>If you did not initiate this action or the code does not match, please close this window or click abort.</small>
</p>
<div v-html="form" class="device-form"></div>
<button type="submit" form="op.deviceConfirmForm" class="device-submit" autofocus>Continue</button>
<div class="help">
<button type="submit" form="op.deviceConfirmForm" value="yes" name="abort" class="abort-link">[ Abort ]</button>
</div>
</div>
</PublicPageLayout>
</template>
<style scoped>
.user-code {
font-size: 2em;
}
.device-submit {
width: 100%;
display: block;
margin-top: 12px;
text-align: center;
font-size: 14px;
font-weight: 700;
height: 36px;
padding: 0 8px;
border: 0;
color: #fff;
background-color: #4d90fe;
cursor: pointer;
border-radius: 4px;
}
.device-submit:hover {
background-color: #357ae8;
}
.help {
width: 100%;
font-size: 12px;
text-align: center;
margin-top: 8px;
}
.abort-link {
background: none;
border: none;
padding: 0;
font: inherit;
cursor: pointer;
color: #666;
opacity: 0.6;
}
.abort-link:hover {
opacity: 1;
}
</style>