diff options
author | Chocobozzz <me@florianbigard.com> | 2019-06-07 16:59:53 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-06-07 17:05:42 +0200 |
commit | 1f20622f2b087eaf8738d60fae00a44b9c558ca3 (patch) | |
tree | 1c8554623665ca96b8a1e6f2a6bcb8c1b5a83c2e /server/initializers | |
parent | 1a03bea0c42fa1064ce4770157b4fd2e3edd5565 (diff) | |
download | PeerTube-1f20622f2b087eaf8738d60fae00a44b9c558ca3.tar.gz PeerTube-1f20622f2b087eaf8738d60fae00a44b9c558ca3.tar.zst PeerTube-1f20622f2b087eaf8738d60fae00a44b9c558ca3.zip |
Improve registration
* Add ability to set the user display name
* Use display name to guess the username/channel name
* Add explanations about what is the purpose of a username/channel name
* Add a loader at the "done" step
Diffstat (limited to 'server/initializers')
-rw-r--r-- | server/initializers/installer.ts | 2 | ||||
-rw-r--r-- | server/initializers/migrations/0100-activitypub.ts | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/server/initializers/installer.ts b/server/initializers/installer.ts index e14554ede..cb58454cb 100644 --- a/server/initializers/installer.ts +++ b/server/initializers/installer.ts | |||
@@ -146,7 +146,7 @@ async function createOAuthAdminIfNotExist () { | |||
146 | } | 146 | } |
147 | const user = new UserModel(userData) | 147 | const user = new UserModel(userData) |
148 | 148 | ||
149 | await createUserAccountAndChannelAndPlaylist(user, undefined, validatePassword) | 149 | await createUserAccountAndChannelAndPlaylist({ userToCreate: user, channelNames: undefined, validateUser: validatePassword }) |
150 | logger.info('Username: ' + username) | 150 | logger.info('Username: ' + username) |
151 | logger.info('User password: ' + password) | 151 | logger.info('User password: ' + password) |
152 | } | 152 | } |
diff --git a/server/initializers/migrations/0100-activitypub.ts b/server/initializers/migrations/0100-activitypub.ts index 2880a97d9..96d44a7ce 100644 --- a/server/initializers/migrations/0100-activitypub.ts +++ b/server/initializers/migrations/0100-activitypub.ts | |||
@@ -65,7 +65,12 @@ async function up (utils: { | |||
65 | // Create application account | 65 | // Create application account |
66 | { | 66 | { |
67 | const applicationInstance = await ApplicationModel.findOne() | 67 | const applicationInstance = await ApplicationModel.findOne() |
68 | const accountCreated = await createLocalAccountWithoutKeys(SERVER_ACTOR_NAME, null, applicationInstance.id, undefined) | 68 | const accountCreated = await createLocalAccountWithoutKeys({ |
69 | name: SERVER_ACTOR_NAME, | ||
70 | userId: null, | ||
71 | applicationId: applicationInstance.id, | ||
72 | t: undefined | ||
73 | }) | ||
69 | 74 | ||
70 | const { publicKey, privateKey } = await createPrivateAndPublicKeys() | 75 | const { publicKey, privateKey } = await createPrivateAndPublicKeys() |
71 | accountCreated.Actor.publicKey = publicKey | 76 | accountCreated.Actor.publicKey = publicKey |
@@ -83,7 +88,7 @@ async function up (utils: { | |||
83 | // Recreate accounts for each user | 88 | // Recreate accounts for each user |
84 | const users = await db.User.findAll() | 89 | const users = await db.User.findAll() |
85 | for (const user of users) { | 90 | for (const user of users) { |
86 | const account = await createLocalAccountWithoutKeys(user.username, user.id, null, undefined) | 91 | const account = await createLocalAccountWithoutKeys({ name: user.username, userId: user.id, applicationId: null, t: undefined }) |
87 | 92 | ||
88 | const { publicKey, privateKey } = await createPrivateAndPublicKeys() | 93 | const { publicKey, privateKey } = await createPrivateAndPublicKeys() |
89 | account.Actor.publicKey = publicKey | 94 | account.Actor.publicKey = publicKey |