Compare commits
4 Commits
features/d
...
bug-featur
Author | SHA1 | Date | |
---|---|---|---|
8f24bb3cc1 | |||
fe8ea62a98 | |||
3b7f4d025d | |||
80737a2927 |
3
.env.example
Normal file
3
.env.example
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
VITE_AKEYLESS_ACCESS_ID=""
|
||||||
|
VITE_AKEYLESS_ACCESS_KEY=""
|
||||||
|
VITE_AKEYLESS_KEY_PATH=""
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -22,4 +22,4 @@ dist-ssr
|
|||||||
*.njsproj
|
*.njsproj
|
||||||
*.sln
|
*.sln
|
||||||
*.sw?
|
*.sw?
|
||||||
tokens.ts
|
.env
|
@ -2,7 +2,4 @@ import "./style.css";
|
|||||||
|
|
||||||
import { tokenList } from "./tokenList";
|
import { tokenList } from "./tokenList";
|
||||||
import rootDiv from "./utils/root";
|
import rootDiv from "./utils/root";
|
||||||
|
rootDiv!.innerHTML = await tokenList();
|
||||||
rootDiv!.innerHTML = `
|
|
||||||
${tokenList()}
|
|
||||||
`;
|
|
||||||
|
@ -2,6 +2,11 @@ export function toast(element: HTMLDivElement, message: string) {
|
|||||||
// Target our predefined DIV that will hold toast messages.
|
// Target our predefined DIV that will hold toast messages.
|
||||||
const toastDiv = element.getElementsByClassName('toast')
|
const toastDiv = element.getElementsByClassName('toast')
|
||||||
|
|
||||||
|
const interval = setInterval(() => {
|
||||||
|
toastDiv[0].remove()
|
||||||
|
clearInterval(interval)
|
||||||
|
}, 5000)
|
||||||
|
|
||||||
// If we currently have a toast displayed, let's remove it from the DOM.
|
// If we currently have a toast displayed, let's remove it from the DOM.
|
||||||
if (toastDiv && toastDiv.length != 0) {
|
if (toastDiv && toastDiv.length != 0) {
|
||||||
for (const el of toastDiv){
|
for (const el of toastDiv){
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import totp from 'totp-generator'
|
import totp from 'totp-generator'
|
||||||
const period = 30
|
const period = 30
|
||||||
const digits = 6
|
const digits = 6
|
||||||
|
|
||||||
export function displayToken(secret: string) {
|
export function displayToken(secret: string) {
|
||||||
const token = totp(secret.replace(/ /g, '').trim(), {
|
const token = totp(secret.replace(/ /g, '').trim(), {
|
||||||
digits,
|
digits,
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import { displayTokenListItem } from "./tokenListItem";
|
import { displayTokenListItem } from "./tokenListItem";
|
||||||
import { tokens } from "./tokens";
|
import { tokens } from "./tokens";
|
||||||
|
import { Token } from "./utils/types";
|
||||||
export function tokenList() {
|
console.log('tokens', tokens)
|
||||||
return `<form id="tokens">${tokens.map((token) =>
|
export async function tokenList() {
|
||||||
|
return `<form id="tokens">${tokens.map((token: Token) =>
|
||||||
displayTokenListItem(token.account, token.secret)
|
displayTokenListItem(token.account, token.secret)
|
||||||
)}</form>`;
|
)}</form>`;
|
||||||
}
|
}
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
export const tokens = [
|
|
||||||
{
|
|
||||||
account: 'Github',
|
|
||||||
secret: 'AFDAFDAFAFFD',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
account: 'Gmail',
|
|
||||||
secret: 'AFDJKADFJsddfsKLAFSJLK',
|
|
||||||
},
|
|
||||||
]
|
|
10
src/tokens.ts
Normal file
10
src/tokens.ts
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
export const tokens = [
|
||||||
|
{
|
||||||
|
"account": "Github",
|
||||||
|
"secret": "AFDAFDAFAFFD"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"account": "Gmail",
|
||||||
|
"secret": "AFDJKADFJsddfsKLAFSJLK"
|
||||||
|
}
|
||||||
|
]
|
15
src/utils/types.ts
Normal file
15
src/utils/types.ts
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import { tokens } from "../tokens";
|
||||||
|
|
||||||
|
export interface TokenResponse {
|
||||||
|
token: string;
|
||||||
|
creds: null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Token {
|
||||||
|
account: string;
|
||||||
|
secret: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface GenericAPIResponse {
|
||||||
|
result: string;
|
||||||
|
}
|
Reference in New Issue
Block a user