add Nostr-login package #217
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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 {
|
||||||
|
@ -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)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user