refactor: add comments
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 32s

This commit is contained in:
enes 2024-10-08 20:25:34 +02:00
parent f09d9b2378
commit 3a507246ca
3 changed files with 30 additions and 5 deletions

View File

@ -23,8 +23,20 @@ export interface Keys {
export interface AuthState { export interface AuthState {
loggedIn: boolean loggedIn: boolean
usersPubkey?: string usersPubkey?: string
/**
* sigit login {@link LoginMethod methods }
* @see {@link LoginMethod}
*/
loginMethod?: LoginMethod loginMethod?: LoginMethod
/**
* nostr-login package specific {@link NostrLoginAuthMethod method }
* @see {@link NostrLoginAuthMethod}
*/
nostrLoginAuthMethod?: NostrLoginAuthMethod nostrLoginAuthMethod?: NostrLoginAuthMethod
/**
* {@link Keys keyPair} for user auth (usually only public is available)
* @see {@link Keys}
*/
keyPair?: Keys keyPair?: Keys
} }

View File

@ -40,10 +40,24 @@ export interface Sigit {
} }
export interface UserAppData { export interface UserAppData {
sigits: { [key: string]: Meta } // key will be id of create signature /**
processedGiftWraps: string[] // an array of ids of processed gift wrapped events * Key will be id of create signature
keyPair?: Keys // this key pair is used for blossom requests authentication */
blossomUrls: string[] // array for storing Urls for the files that stores all the sigits and processedGiftWraps on blossom sigits: { [key: string]: Meta }
/**
* An array of ids of processed gift wrapped events
*/
processedGiftWraps: string[]
/**
* Generated ephemeral key pair (https://docs.sigit.io/#/technical?id=storing-app-data).
* This {@link Keys key pair} is used for blossom requests authentication.
* @see {@link Keys}
*/
keyPair?: Keys
/**
* Array for storing Urls for the files that stores all the sigits and processedGiftWraps on blossom.
*/
blossomUrls: string[]
} }
export interface DocSignatureEvent extends Event { export interface DocSignatureEvent extends Event {

View File

@ -426,7 +426,6 @@ export const getUsersAppData = async (): Promise<UserAppData | null> => {
// Handle case where the encrypted content is an empty object // Handle case where the encrypted content is an empty object
if (encryptedContent === '{}') { if (encryptedContent === '{}') {
// Generate ephemeral key pair // Generate ephemeral key pair
// https://docs.sigit.io/#/technical?id=storing-app-data
const secret = generateSecretKey() const secret = generateSecretKey()
const pubKey = getPublicKey(secret) const pubKey = getPublicKey(secret)