diff --git a/CHANGELOG.md b/CHANGELOG.md
index 735e9505..6f065ec4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,18 @@
All notable changes to this project will be documented in this file.
+## 4.7.3
+### Fixes
+* fix: apply username from backend instead of guessing by @susnux in https://github.com/nextcloud/guests/pull/1571
+
+## 4.7.2
+### Fixes
+* fix(src): resolve 20 bugs, logic flaws, type issues and prose errors across the frontend by @copilot-swe-agent in https://github.com/nextcloud/guests/pull/1552
+
+### Other
+* Chore(deps): Bump @nextcloud/axios from 2.5.2 to 2.6.0 by @dependabot[bot] in https://github.com/nextcloud/guests/pull/1549
+* Chore(deps): Bump axios from 1.15.0 to 1.16.0 by @dependabot[bot] in https://github.com/nextcloud/guests/pull/1554
+
## 4.7.1
### Fixes
* fix(vue3): expose t() in components broken by Vue 3 migration by @pringelmann in https://github.com/nextcloud/guests/pull/1551
diff --git a/appinfo/info.xml b/appinfo/info.xml
index 850767d5..de1e1aa8 100755
--- a/appinfo/info.xml
+++ b/appinfo/info.xml
@@ -14,7 +14,7 @@
Guests accounts can be created from the share menu by entering either the recipients email or name and choosing "create guest account", once the share is created the guest user will receive an email notification about the mail with a link to set their password.
Guests users can only access files shared to them and cannot create any files outside of shares, additionally, the apps accessible to guest accounts are whitelisted.]]>
- 4.7.2
+ 4.7.3
agpl
Nextcloud
diff --git a/lib/Controller/UsersController.php b/lib/Controller/UsersController.php
index e3a3a0c8..441eab21 100644
--- a/lib/Controller/UsersController.php
+++ b/lib/Controller/UsersController.php
@@ -173,6 +173,7 @@ public function create(string $email, string $displayName, string $language, arr
'message' => $this->l10n->t(
'User successfully created'
),
+ 'username' => $username,
],
Http::STATUS_CREATED
);
diff --git a/package-lock.json b/package-lock.json
index 173d6fb3..de90badb 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "guests",
- "version": "4.7.1",
+ "version": "4.7.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "guests",
- "version": "4.7.1",
+ "version": "4.7.3",
"license": "agpl",
"dependencies": {
"@mdi/svg": "^7.4.47",
diff --git a/package.json b/package.json
index eb4762d1..08277784 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "guests",
"description": "Create guest users which can only see files shared with them",
- "version": "4.7.1",
+ "version": "4.7.3",
"type": "module",
"author": "Robin Appelman ",
"contributors": [
diff --git a/src/views/GuestForm.vue b/src/views/GuestForm.vue
index 2074bce2..5ca38faf 100644
--- a/src/views/GuestForm.vue
+++ b/src/views/GuestForm.vue
@@ -171,15 +171,7 @@ export default {
watch: {
'guest.email': function() {
- if (this.guest.email) {
- this.guest.username = this.guest.email
- } else {
- this.guest.username = ''
- }
-
- this.$nextTick(() => {
- this.resetErrors()
- })
+ this.resetErrors()
},
},
@@ -233,7 +225,7 @@ export default {
this.loading = true
try {
- await axios.put(generateOcsUrl('/apps/guests/api/v1/users'), {
+ const { data } = await axios.put(generateOcsUrl('/apps/guests/api/v1/users'), {
displayName: this.guest.fullName,
email: this.guest.email,
language: this.guest.language,
@@ -241,6 +233,9 @@ export default {
sendInvite: this.integrationApp !== 'files',
})
+ // ensure the username is set - we do not know it in advance as it is generated by the backend
+ this.guest.username = data.ocs.data.username
+
if (this.integrationApp === 'files') {
await this.setupGuestShare()
return
diff --git a/tests/unit/Controller/UsersControllerTest.php b/tests/unit/Controller/UsersControllerTest.php
index 67cdc4f7..e47ada89 100644
--- a/tests/unit/Controller/UsersControllerTest.php
+++ b/tests/unit/Controller/UsersControllerTest.php
@@ -707,7 +707,10 @@ public function testCreateSuccessWithGroupsAsSubadmin(): void {
$response = $this->controller->create('new@example.com', 'Test User', 'en', ['group1', 'group2']);
$this->assertEquals(Http::STATUS_CREATED, $response->getStatus());
- $this->assertEquals(['message' => 'User successfully created'], $response->getData());
+ $this->assertEquals([
+ 'message' => 'User successfully created',
+ 'username' => 'new@example.com',
+ ], $response->getData());
}
/**