Add impersonate dialog

This commit is contained in:
Johannes Zellner
2025-02-12 15:54:04 +01:00
parent c9d875e3fa
commit da0dcf65b3
3 changed files with 105 additions and 1 deletions
+15
View File
@@ -39,6 +39,21 @@ function create() {
return [e];
}
if (result.status !== 204) return [result];
return [null];
},
async setGhost(id, password, expiresAt = 0) {
const data = { password };
if (expiresAt) data.expiresAt = expiresAt;
let result;
try {
result = await fetcher.post(`${origin}/api/v1/users/${id}/ghost`, data, { access_token: accessToken });
} catch (e) {
return [e];
}
if (result.status !== 204) return [result];
return [null];
},