Skip to content

Commit

Permalink
fix(account-form): Added support for 'path' in the authentication form
Browse files Browse the repository at this point in the history
  • Loading branch information
andris9 committed Apr 11, 2024
1 parent 037091b commit 198ba41
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/routes-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -6215,7 +6215,6 @@ ${Buffer.from(data.content, 'base64url').toString('base64')}

async function accountFormHandler(request, h) {
const data = await parseSignedFormData(redis, request.payload, gt);

const oauth2App = await oauth2Apps.get(request.payload.type);

if (oauth2App && oauth2App.enabled) {
Expand All @@ -6225,7 +6224,7 @@ ${Buffer.from(data.content, 'base64url').toString('base64')}
account: data.account
};

for (let key of ['name', 'email', 'syncFrom']) {
for (let key of ['name', 'email', 'syncFrom', 'path']) {
if (data[key]) {
accountData[key] = data[key];
}
Expand Down Expand Up @@ -6637,6 +6636,7 @@ ${Buffer.from(data.content, 'base64url').toString('base64')}
notifyFrom: data.notifyFrom ? new Date(data.notifyFrom) : new Date(),

syncFrom: data.syncFrom || null,
path: data.path || null,

imap: {
host: request.payload.imap_host,
Expand Down
1 change: 1 addition & 0 deletions lib/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -1374,6 +1374,7 @@ MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEV3QUiYsp13nD9suD1/ZkEXnuMoSg
subconnections: opts.subconnections && opts.subconnections.length ? opts.subconnections : null,
redirectUrl: opts.redirectUrl,
delegated: opts.delegated,
path: opts.path,
n: opts.n,
t: opts.t
})
Expand Down
3 changes: 3 additions & 0 deletions workers/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -2183,6 +2183,7 @@ When making API calls remember that requests against the same account are queued
subconnections: request.payload.subconnections,
redirectUrl: request.payload.redirectUrl,
delegated: request.payload.delegated,
path: request.payload.path && !request.payload.path.includes('*') ? request.payload.path : null,
// identify request
n: crypto.randomBytes(NONCE_BYTES).toString('base64'),
t: Date.now()
Expand Down Expand Up @@ -2286,6 +2287,8 @@ When making API calls remember that requests against the same account are queued

subconnections: accountSchemas.subconnections,

path: accountPathSchema.example(['*']).label('AccountFormPath'),

redirectUrl: Joi.string()
.empty('')
.uri({ scheme: ['http', 'https'], allowRelative: false })
Expand Down

0 comments on commit 198ba41

Please sign in to comment.