forked from cory/tildefriends
Disallow creating accounts as a guest. #52
This commit is contained in:
parent
46e711f0a5
commit
f79d7b35a4
@ -78,7 +78,7 @@ async function main() {
|
||||
alert('Successfully created: ' + id);
|
||||
await tfrpc.rpc.reload();
|
||||
} catch (e) {
|
||||
alert('Error creating identity: ' + e);
|
||||
alert('Error creating identity: ' + e.message);
|
||||
}
|
||||
}
|
||||
handler.hide_id = function hide_id(event, element) {
|
||||
|
@ -208,7 +208,7 @@ class TfNavigationElement extends LitElement {
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
} else {
|
||||
} else if (this.credentials?.session?.name && this.credentials.session.name !== 'guest') {
|
||||
return html`
|
||||
<link type="text/css" rel="stylesheet" href="/static/w3.css" />
|
||||
<button
|
||||
|
@ -577,7 +577,8 @@ async function getProcessBlob(blobId, key, options) {
|
||||
if (
|
||||
process.credentials &&
|
||||
process.credentials.session &&
|
||||
process.credentials.session.name
|
||||
process.credentials.session.name &&
|
||||
process.credentials.session.name !== 'guest'
|
||||
) {
|
||||
let id = ssb.createIdentity(process.credentials.session.name);
|
||||
await process.sendIdentities();
|
||||
@ -595,6 +596,8 @@ async function getProcessBlob(blobId, key, options) {
|
||||
]
|
||||
);
|
||||
return id;
|
||||
} else {
|
||||
throw new Error('Must be signed-in to create an account.');
|
||||
}
|
||||
};
|
||||
if (process.credentials?.permissions?.administration) {
|
||||
|
Loading…
Reference in New Issue
Block a user