diff --git a/packages/app-desktop/gui/ClipperConfigScreen.jsx b/packages/app-desktop/gui/ClipperConfigScreen.jsx index 20e31b51b..be5d0b628 100644 --- a/packages/app-desktop/gui/ClipperConfigScreen.jsx +++ b/packages/app-desktop/gui/ClipperConfigScreen.jsx @@ -7,6 +7,7 @@ const ClipperServer = require('@joplin/lib/ClipperServer'); const Setting = require('@joplin/lib/models/Setting').default; const { clipboard } = require('electron'); const ExtensionBadge = require('./ExtensionBadge.min'); +const EncryptionService = require('@joplin/lib/services/EncryptionService').default; class ClipperConfigScreenComponent extends React.Component { constructor() { @@ -39,6 +40,16 @@ class ClipperConfigScreenComponent extends React.Component { alert(_('Token has been copied to the clipboard!')); } + renewToken_click() { + if (confirm(_('Are you sure you want to renew the authorisation token?'))) { + void EncryptionService.instance() + .generateApiToken() + .then((token: string) => { + Setting.setValue('api.token', token); + }); + } + } + render() { const theme = themeStyle(this.props.themeId); @@ -59,6 +70,10 @@ class ClipperConfigScreenComponent extends React.Component { backgroundColor: theme.backgroundColor, }; + const tokenStyle = { + fontFamily: 'monospace', + }; + const webClipperStatusComps = []; if (this.props.clipperServerAutoStart) { @@ -131,12 +146,17 @@ class ClipperConfigScreenComponent extends React.Component {
{_('Advanced options')}
{_('Authorisation token:')}
- {this.props.apiToken}{' '} + {this.props.apiToken}{' '} {_('Copy token')}
{_('This authorisation token is only needed to allow third-party applications to access Joplin.')}
+