diff --git a/app/builtin-pages/com/editor/settings-form.js b/app/builtin-pages/com/editor/settings-form.js
index 5f7c6961f7..44ea9e8973 100644
--- a/app/builtin-pages/com/editor/settings-form.js
+++ b/app/builtin-pages/com/editor/settings-form.js
@@ -72,7 +72,7 @@ export function render (workingCheckout, isReadonly, archiveInfo, workingDatJson
isReadonly,
label: 'Follows API',
documentation: 'dat://unwalled.garden/docs/api/follows',
- perm: 'unwalled.garden/perm/follows',
+ perm: 'unwalled.garden/api/follows',
caps: [
{id: 'read', description: 'Read the user\'s followers'},
{id: 'write', description: 'Follow and unfollow users'}
@@ -82,7 +82,7 @@ export function render (workingCheckout, isReadonly, archiveInfo, workingDatJson
isReadonly,
label: 'Posts API',
documentation: 'dat://unwalled.garden/docs/api/posts',
- perm: 'unwalled.garden/perm/posts',
+ perm: 'unwalled.garden/api/posts',
caps: [
{id: 'read', description: 'Read the user\'s feed'},
{id: 'write', description: 'Post to the user\'s feed'}
@@ -92,7 +92,7 @@ export function render (workingCheckout, isReadonly, archiveInfo, workingDatJson
isReadonly,
label: 'Bookmarks API',
documentation: 'dat://unwalled.garden/docs/api/bookmarks',
- perm: 'unwalled.garden/perm/bookmarks',
+ perm: 'unwalled.garden/api/bookmarks',
caps: [
{id: 'read', description: 'Read the user\'s bookmarks'},
{id: 'write', description: 'Create and edit the user\'s bookmarks'}
@@ -102,7 +102,7 @@ export function render (workingCheckout, isReadonly, archiveInfo, workingDatJson
isReadonly,
label: 'Comments API',
documentation: 'dat://unwalled.garden/docs/api/comments',
- perm: 'unwalled.garden/perm/comments',
+ perm: 'unwalled.garden/api/comments',
caps: [
{id: 'read', description: 'Read the user\'s comments'},
{id: 'write', description: 'Create and edit the user\'s comments'}
@@ -112,7 +112,7 @@ export function render (workingCheckout, isReadonly, archiveInfo, workingDatJson
isReadonly,
label: 'Reactions API',
documentation: 'dat://unwalled.garden/docs/api/reactions',
- perm: 'unwalled.garden/perm/reactions',
+ perm: 'unwalled.garden/api/reactions',
caps: [
{id: 'read', description: 'Read the user\'s reactions'},
{id: 'write', description: 'Create and edit the user\'s reactions'}
@@ -122,7 +122,7 @@ export function render (workingCheckout, isReadonly, archiveInfo, workingDatJson
isReadonly,
label: 'Votes API',
documentation: 'dat://unwalled.garden/docs/api/votes',
- perm: 'unwalled.garden/perm/votes',
+ perm: 'unwalled.garden/api/votes',
caps: [
{id: 'read', description: 'Read the user\'s votes'},
{id: 'write', description: 'Create and edit the user\'s votes'}
diff --git a/app/lib/strings.js b/app/lib/strings.js
index 7fdbf7f7ab..2e48adf11c 100644
--- a/app/lib/strings.js
+++ b/app/lib/strings.js
@@ -1,6 +1,7 @@
/* globals window */
const URL = typeof window === 'undefined' ? require('url').URL : window.URL
+export const DAT_KEY_REGEX = /[0-9a-f]{64}/i
export function ucfirst (str) {
if (!str) str = ''
@@ -51,3 +52,17 @@ export function getHostname (str) {
return str
}
}
+
+export function toNiceUrl (str) {
+ if (!str) return ''
+ try {
+ var urlParsed = new URL(str)
+ if (DAT_KEY_REGEX.test(urlParsed.hostname)) {
+ urlParsed.hostname = `${urlParsed.hostname.slice(0, 4)}..${urlParsed.hostname.slice(-2)}`
+ }
+ return urlParsed.toString()
+ } catch (e) {
+ // ignore, not a url
+ }
+ return str
+}
\ No newline at end of file
diff --git a/app/modals.js b/app/modals.js
index 0d5adb1b25..aef65381c5 100644
--- a/app/modals.js
+++ b/app/modals.js
@@ -9,6 +9,7 @@ import './modals/select-file'
import './modals/prompt'
import './modals/basic-auth'
import './modals/user'
+import './modals/create-user-session'
import './modals/install-application'
class ModalsWrapper extends LitElement {
@@ -79,6 +80,8 @@ class ModalsWrapper extends LitElement {
return html`