Skip to content
Merged

v4.7.3 #1573

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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.]]></description>
<version>4.7.2</version>
<version>4.7.3</version>
<licence>agpl</licence>
<author>Nextcloud</author>
<types>
Expand Down
1 change: 1 addition & 0 deletions lib/Controller/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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 <robin@icewind.nl>",
"contributors": [
Expand Down
15 changes: 5 additions & 10 deletions src/views/GuestForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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()
},
},

Expand Down Expand Up @@ -233,14 +225,17 @@ 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,
groups: this.guest.groups,
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
Expand Down
5 changes: 4 additions & 1 deletion tests/unit/Controller/UsersControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

/**
Expand Down
Loading