Fix display names for key generation

This commit is contained in:
Elizabeth Cray 2022-09-08 00:12:37 +00:00
parent 8e7e0aade7
commit 2fe896abb0
2 changed files with 13 additions and 0 deletions

View File

@ -19,6 +19,16 @@ const SwalConfig = {
buttonsStyling: false,
}
const invalidChars = ['/', '\\', '>', '<', ':', '*', '|', '"', '\'', '?', '\0'];
const replaceInvalid = (str) => {
var cache = str;
invalidChars.forEach(ch => {
cache = cache.replace(ch, "#");
});
return cache;
}
const isOverflown = ({ clientHeight, scrollHeight }) => scrollHeight > clientHeight
const setCookie = (cname, cvalue, exdays) => {
@ -134,6 +144,7 @@ const generateSSH = async (name, id, token) => {
generateKeyPair("RSASSA-PKCS1-v1_5", 4096, "namehere")
.then((keys) => {
var KeyExport = new JSZip();
name = replaceInvalid(name);
KeyExport.file("HackersTownTTY-"+name, keys[0]);
KeyExport.file("HackersTownTTY-"+name+".pub", keys[1]);
KeyExport.generateAsync({type:"blob"})

View File

@ -1,4 +1,6 @@
<?php
// echo exec('whoami');
exit();
$z=1/0;
use Lrf141\OAuth2\Client\Provider\Mastodon;