Release v2.20.1: migrate authentication to Better Auth

This commit is contained in:
lzstealth committed 2026-10-25 18:19:55 +00:00
1 parent e9a53f577c
commit fba4f99ff7
92 files changed
+5085 -1943

No files matched your search

+6 -2
View File
@@ -7,6 +7,7 @@ const registerUsersRoutes = require('../src/web/routes/admin/users');
test('user edit save and new goes to the blank create page', async () => {
const handlers = {};
let mustChangePasswordValue = null;
const app = {
get() {},
post(path, ...routeHandlers) {
@@ -28,8 +29,9 @@ test('user edit save and new goes to the blank create page', async () => {
async getConnection() {
return {
async beginTransaction() {},
async query(sql) {
if (sql.includes('UPDATE a_users SET name = ?, username = ?, account_locked = ?, modified_by = ? WHERE id = ?')) {
async query(sql, params) {
if (sql.includes('UPDATE a_users SET name = ?, username = ?, account_locked = ?, must_change_password = ?, modified_by = ? WHERE id = ?')) {
mustChangePasswordValue = params[3];
return [{ affectedRows: 1 }];
}
return [[]];
@@ -75,6 +77,7 @@ test('user edit save and new goes to the blank create page', async () => {
body: {
name: 'User',
username: 'user',
must_change_password: '1',
save_action: 'new'
},
currentUser: { id: 1 }
@@ -94,4 +97,5 @@ test('user edit save and new goes to the blank create page', async () => {
await routeHandlers[1](req, res, () => {});
assert.equal(res.redirectedTo, '/settings/users/new?message=User%20updated.');
assert.equal(mustChangePasswordValue, 1);
});