Restyle oidc device login views
This commit is contained in:
@@ -25,7 +25,6 @@ import { HttpError } from '@cloudron/connect-lastmile';
|
||||
import * as jose from 'jose';
|
||||
import safe from 'safetydance';
|
||||
import settings from './settings.js';
|
||||
import superagent from '@cloudron/superagent';
|
||||
import tokens from './tokens.js';
|
||||
import users from './users.js';
|
||||
import groups from './groups.js';
|
||||
@@ -725,6 +724,7 @@ async function start() {
|
||||
charset: 'base-20',
|
||||
mask: '****-****',
|
||||
userCodeInputSource: async function (ctx, form, out, err) {
|
||||
// below errors and message is currently unused
|
||||
let message;
|
||||
if (err && (err.userCode || err.name === 'NoCodeError')) {
|
||||
message = '<p class="red">The code you entered is incorrect. Try again</p>';
|
||||
@@ -735,13 +735,24 @@ async function start() {
|
||||
} else {
|
||||
message = '<p>Enter the code displayed on your device</p>';
|
||||
}
|
||||
ctx.body = ejs.render(TEMPLATE_DEVICE_INPUT, { message, form });
|
||||
ctx.body = ejs.render(TEMPLATE_DEVICE_INPUT, {
|
||||
name: await branding.getCloudronName(),
|
||||
message,
|
||||
form
|
||||
});
|
||||
},
|
||||
userCodeConfirmSource: async function (ctx, form, client, deviceInfo, userCode) {
|
||||
ctx.body = ejs.render(TEMPLATE_DEVICE_CONFIRM, { clientName: ctx.oidc.client.clientName || ctx.oidc.client.clientId, userCode, form });
|
||||
ctx.body = ejs.render(TEMPLATE_DEVICE_CONFIRM, {
|
||||
name: await branding.getCloudronName(),
|
||||
clientName: ctx.oidc.client.clientName || ctx.oidc.client.clientId,
|
||||
userCode,
|
||||
form
|
||||
});
|
||||
},
|
||||
successSource: async function (ctx) {
|
||||
ctx.body = ejs.render(TEMPLATE_DEVICE_SUCCESS, {});
|
||||
ctx.body = ejs.render(TEMPLATE_DEVICE_SUCCESS, {
|
||||
name: await branding.getCloudronName()
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user