Skip to content

Commit

Permalink
Fill Security component with values
Browse files Browse the repository at this point in the history
Load from initial state

Signed-off-by: Vitor Mattos <[email protected]>
  • Loading branch information
vitormattos committed Jul 17, 2023
1 parent 4772bd3 commit 483f915
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Controller/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use OCA\MyCompany\AppInfo\Application;
use OCA\Settings\Settings\Personal\PersonalInfo;
use OCA\Settings\Settings\Personal\Security\Authtokens;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
Expand All @@ -14,7 +15,8 @@
class PageController extends Controller {
public function __construct(
IRequest $request,
private PersonalInfo $personalInfo
private PersonalInfo $personalInfo,
private Authtokens $authTokens,
) {
parent::__construct(Application::APP_ID, $request);
}
Expand Down
14 changes: 14 additions & 0 deletions src/views/Security.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,32 @@
<div id="personal-settings">
<h2 class="hidden-visually">{{ t('my_company', 'Security') }}</h2>
<PasswordSection />
<AuthTokenSection
:tokens="tokens"
:canCreateToken="canCreateToken"
/>
</div>
</div>
</template>

<script>
import PasswordSection from 'apps/settings/src/components/PasswordSection.vue'
import AuthTokenSection from 'apps/settings/src/components/AuthTokenSection.vue'
import { loadState } from '@nextcloud/initial-state'
export default {
name: 'Profile',
data() {
return {
tokens: loadState('settings', 'app_tokens'),
canCreateToken: loadState('settings', 'can_create_app_token'),
}
},
components: {
PasswordSection,
AuthTokenSection,
},
}
</script>

0 comments on commit 483f915

Please sign in to comment.