mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
feat: Store account settings separately
Account settings are stored using the WebID as key. Reason for using the WebID is that this allows faster access to the settings in authenticated requests. A consequence of this is that passwords are now always required during registration, and that there can only be 1 account per WebID.
This commit is contained in:
@@ -23,7 +23,15 @@ const configs: [string, any][] = [
|
||||
// Tests are very similar to subdomain/pod tests. Would be nice if they can be combined
|
||||
describe.each(configs)('A dynamic pod server with template config %s', (template, { teardown }): void => {
|
||||
let app: App;
|
||||
const settings = { podName: 'alice', webId: 'http://test.com/#alice', email: 'alice@test.email', template, createPod: true };
|
||||
const settings = {
|
||||
podName: 'alice',
|
||||
webId: 'http://test.com/#alice',
|
||||
email: 'alice@test.email',
|
||||
password: 'password',
|
||||
confirmPassword: 'password',
|
||||
template,
|
||||
createPod: true,
|
||||
};
|
||||
const podUrl = `${baseUrl}${settings.podName}/`;
|
||||
|
||||
beforeAll(async(): Promise<void> => {
|
||||
@@ -109,10 +117,11 @@ describe.each(configs)('A dynamic pod server with template config %s', (template
|
||||
});
|
||||
|
||||
it('should not be able to create a pod with the same name.', async(): Promise<void> => {
|
||||
const newSettings = { ...settings, webId: 'http://test.com/#bob', email: 'bob@test.email' };
|
||||
const res = await fetch(`${baseUrl}idp/register`, {
|
||||
method: 'POST',
|
||||
headers: { 'content-type': 'application/json' },
|
||||
body: JSON.stringify(settings),
|
||||
body: JSON.stringify(newSettings),
|
||||
});
|
||||
expect(res.status).toBe(409);
|
||||
await expect(res.text()).resolves.toContain(`There already is a pod at ${podUrl}`);
|
||||
|
||||
Reference in New Issue
Block a user