refactor: use app-owned secure login provider
This commit is contained in:
parent
fed2ff135b
commit
5e90b828b4
25 changed files with 25 additions and 25 deletions
|
|
@ -16,7 +16,7 @@ import NostrProvider from '@/components/NostrProvider';
|
|||
import { NostrSync } from '@/components/NostrSync';
|
||||
import { Toaster } from "@/components/ui/toaster";
|
||||
import { TooltipProvider } from "@/components/ui/tooltip";
|
||||
import { NostrLoginProvider } from '@nostrify/react/login';
|
||||
import { NostrLoginProvider } from '@/lib/nostrLogin';
|
||||
import { AppProvider } from '@/components/AppProvider';
|
||||
import { NWCProvider } from '@/contexts/NWCContext';
|
||||
import { LanguageProvider } from '@/contexts/LanguageContext';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { KeyRound } from 'lucide-react';
|
||||
|
||||
import { useCurrentUser } from '@/hooks/useCurrentUser';
|
||||
import { useNostrLogin } from '@nostrify/react/login';
|
||||
import { useNostrLogin } from '@/lib/nostrLogin';
|
||||
import { isInteractiveSigner } from '@/lib/signerCapabilities';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { useTranslation } from '@/contexts/language';
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import { Skeleton } from '@/components/ui/skeleton';
|
|||
|
||||
import { useCurrentUser } from '@/hooks/useCurrentUser';
|
||||
import { useTranslation } from '@/contexts/language';
|
||||
import { useNostrLogin } from '@nostrify/react/login';
|
||||
import { useNostrLogin } from '@/lib/nostrLogin';
|
||||
import { hasNip44 as checkNip44 } from '@/lib/signerCapabilities';
|
||||
import { AmberApprovalHint } from '@/components/AmberApprovalHint';
|
||||
import { useAuthor } from '@/hooks/useAuthor';
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { useEffect, useRef } from 'react';
|
||||
import { useNostr } from '@nostrify/react';
|
||||
import { useNostrLogin } from '@nostrify/react/login';
|
||||
import { useNostrLogin } from '@/lib/nostrLogin';
|
||||
import { useQueryClient } from '@tanstack/react-query';
|
||||
import { NSchema as n } from '@nostrify/nostrify';
|
||||
import { useCurrentUser } from '@/hooks/useCurrentUser';
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { QRCodeCanvas } from '@/components/ui/qrcode';
|
|||
import { useCurrentUser } from '@/hooks/useCurrentUser';
|
||||
import { useLocalStorage } from '@/hooks/useLocalStorage';
|
||||
import { backupConfirmedKey } from '@/lib/backup';
|
||||
import { useNostrLogin } from '@nostrify/react/login';
|
||||
import { useNostrLogin } from '@/lib/nostrLogin';
|
||||
import { toast } from '@/hooks/useToast';
|
||||
import { useTranslation } from '@/contexts/language';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
||||
import { useNostr } from '@nostrify/react';
|
||||
import { useNostrLogin } from '@nostrify/react/login';
|
||||
import { useNostrLogin } from '@/lib/nostrLogin';
|
||||
import { useCurrentUser } from '@/hooks/useCurrentUser';
|
||||
import { hasNip44 as checkNip44, isInteractiveSigner } from '@/lib/signerCapabilities';
|
||||
import {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { useCallback, useMemo, useRef } from 'react';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { useNostrLogin } from '@nostrify/react/login';
|
||||
import { useNostrLogin } from '@/lib/nostrLogin';
|
||||
import { useCurrentUser } from '@/hooks/useCurrentUser';
|
||||
import { useLocalStorage } from '@/hooks/useLocalStorage';
|
||||
import { useSkateRelays } from '@/hooks/useSkateRelays';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { useNostrLogin } from '@nostrify/react/login';
|
||||
import { useNostrLogin } from '@/lib/nostrLogin';
|
||||
import type { NostrSigner } from '@contextvm/sdk/core';
|
||||
import type { JoinRequest } from '@cordn/core';
|
||||
import { useCurrentUser } from '@/hooks/useCurrentUser';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { useNostr } from '@nostrify/react';
|
||||
import { useNostrLogin } from '@nostrify/react/login';
|
||||
import { useNostrLogin } from '@/lib/nostrLogin';
|
||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
||||
import { useCurrentUser } from '@/hooks/useCurrentUser';
|
||||
import { isInteractiveSigner } from '@/lib/signerCapabilities';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { type NLoginType, NUser, useNostrLogin } from '@nostrify/react/login';
|
||||
import { type NLoginType, NUser, useNostrLogin } from '@/lib/nostrLogin';
|
||||
import { useNostr } from '@nostrify/react';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
|||
import { nip44, nip19, generateSecretKey, finalizeEvent, getEventHash, verifyEvent } from 'nostr-tools';
|
||||
|
||||
import type { NostrEvent } from '@nostrify/nostrify';
|
||||
import { useNostrLogin } from '@nostrify/react/login';
|
||||
import { useNostrLogin } from '@/lib/nostrLogin';
|
||||
import { useCurrentUser } from './useCurrentUser';
|
||||
import { useAppContext } from './useAppContext';
|
||||
import { hasNip44 as checkNip44, isInteractiveSigner } from '@/lib/signerCapabilities';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { useNostr } from '@nostrify/react';
|
||||
import { useNostrLogin, type NLoginType } from '@nostrify/react/login';
|
||||
import { useNostrLogin, type NLoginType } from '@/lib/nostrLogin';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { NSchema as n, NostrEvent, NostrMetadata } from '@nostrify/nostrify';
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import {
|
|||
NLogin,
|
||||
type NLoginType,
|
||||
useNostrLogin,
|
||||
} from '@nostrify/react/login';
|
||||
} from '@/lib/nostrLogin';
|
||||
|
||||
// NOTE: This file should not be edited except for adding new login methods.
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import {
|
|||
updatePendingPostStatus,
|
||||
} from '@/lib/offlineCache';
|
||||
import { useCurrentUser } from './useCurrentUser';
|
||||
import { useNostrLogin } from '@nostrify/react/login';
|
||||
import { useNostrLogin } from '@/lib/nostrLogin';
|
||||
import { isInteractiveSigner } from '@/lib/signerCapabilities';
|
||||
import { useToast } from './useToast';
|
||||
import { useTranslation } from '@/contexts/language';
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { useNostr } from '@nostrify/react';
|
||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
||||
import { useNostrLogin } from '@nostrify/react/login';
|
||||
import { useNostrLogin } from '@/lib/nostrLogin';
|
||||
import { useCurrentUser } from '@/hooks/useCurrentUser';
|
||||
import { isInteractiveSigner } from '@/lib/signerCapabilities';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { useCallback, useEffect, useMemo, useRef } from 'react';
|
||||
import { useNostrLogin } from '@nostrify/react/login';
|
||||
import { useNostrLogin } from '@/lib/nostrLogin';
|
||||
import { useLocalStorage } from '@/hooks/useLocalStorage';
|
||||
import { useCurrentUser } from '@/hooks/useCurrentUser';
|
||||
import { useSyncedAppData, type MergeStrategy } from '@/hooks/useSyncedAppData';
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { useCallback, useState } from 'react';
|
||||
import { useCurrentUser } from './useCurrentUser';
|
||||
import type { NUser } from '@nostrify/react/login';
|
||||
import type { NUser } from '@/lib/nostrLogin';
|
||||
|
||||
// Types for Shakespeare API (compatible with OpenAI ChatCompletionMessageParam)
|
||||
export interface ChatMessage {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { useCallback, useMemo } from 'react';
|
||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
||||
import { useNostr } from '@nostrify/react';
|
||||
import { useNostrLogin } from '@nostrify/react/login';
|
||||
import { useNostrLogin } from '@/lib/nostrLogin';
|
||||
import { useCurrentUser } from './useCurrentUser';
|
||||
import { useNostrPublish } from './useNostrPublish';
|
||||
import { toast } from './useToast';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { useCallback, useEffect, useMemo, useRef } from 'react';
|
||||
import { useQuery, useQueryClient } from '@tanstack/react-query';
|
||||
import { useNostr } from '@nostrify/react';
|
||||
import { useNostrLogin } from '@nostrify/react/login';
|
||||
import { useNostrLogin } from '@/lib/nostrLogin';
|
||||
import { useCurrentUser } from './useCurrentUser';
|
||||
import { useNostrPublish } from './useNostrPublish';
|
||||
import { hasNip44 as checkNip44, isInteractiveSigner } from '@/lib/signerCapabilities';
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/components/ui/tabs';
|
|||
import { LoginArea } from '@/components/auth/LoginArea';
|
||||
import { ZapButton } from '@/components/ZapButton';
|
||||
import { useCurrentUser } from '@/hooks/useCurrentUser';
|
||||
import { useNostrLogin } from '@nostrify/react/login';
|
||||
import { useNostrLogin } from '@/lib/nostrLogin';
|
||||
import { hasNip44 as checkNip44 } from '@/lib/signerCapabilities';
|
||||
import { useAuthor } from '@/hooks/useAuthor';
|
||||
import { useFollowing } from '@/hooks/useFollowing';
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import { Skeleton } from '@/components/ui/skeleton';
|
|||
import { useCurrentUser } from '@/hooks/useCurrentUser';
|
||||
import { useTranslation } from '@/contexts/language';
|
||||
import { useToast } from '@/hooks/useToast';
|
||||
import { useNostrLogin } from '@nostrify/react/login';
|
||||
import { useNostrLogin } from '@/lib/nostrLogin';
|
||||
import { hasNip44 as checkNip44 } from '@/lib/signerCapabilities';
|
||||
import { useConversation, useSendDirectMessage, type DirectMessage } from '@/hooks/useDirectMessages';
|
||||
import { usePendingTradeConfirmations, useTradeAttestation, useIncomingTradeRequests } from '@/hooks/useTradeAttestations';
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import { Skeleton } from '@/components/ui/skeleton';
|
|||
import { NewMessageDialog } from '@/components/NewMessageDialog';
|
||||
import { useTranslation } from '@/contexts/language';
|
||||
import { useCurrentUser } from '@/hooks/useCurrentUser';
|
||||
import { useNostrLogin } from '@nostrify/react/login';
|
||||
import { useNostrLogin } from '@/lib/nostrLogin';
|
||||
import { hasNip44 as checkNip44, isInteractiveSigner } from '@/lib/signerCapabilities';
|
||||
import { useConversations, useGroupConversations, type Conversation } from '@/hooks/useDirectMessages';
|
||||
import { useUserCrews } from '@/hooks/useCrews';
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import { Skeleton } from '@/components/ui/skeleton';
|
|||
import { useCurrentUser } from '@/hooks/useCurrentUser';
|
||||
import { useTranslation } from '@/contexts/language';
|
||||
import { useToast } from '@/hooks/useToast';
|
||||
import { useNostrLogin } from '@nostrify/react/login';
|
||||
import { useNostrLogin } from '@/lib/nostrLogin';
|
||||
import { hasNip44 as checkNip44 } from '@/lib/signerCapabilities';
|
||||
import { useGroupConversation, useSendDirectMessage, getGroupId } from '@/hooks/useDirectMessages';
|
||||
import { useDMRead } from '@/hooks/useDMRead';
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { Alert, AlertDescription } from '@/components/ui/alert';
|
|||
import { Smartphone, Shield, ExternalLink, Star, CheckCircle2, Info, Apple, Chrome } from 'lucide-react';
|
||||
import { useTranslation } from '@/contexts/language';
|
||||
import { useCurrentUser } from '@/hooks/useCurrentUser';
|
||||
import { useNostrLogin } from '@nostrify/react/login';
|
||||
import { useNostrLogin } from '@/lib/nostrLogin';
|
||||
import { isInteractiveSigner } from '@/lib/signerCapabilities';
|
||||
|
||||
// Platform detection
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import { createHead, UnheadProvider } from '@unhead/react/client';
|
||||
import { BrowserRouter } from 'react-router-dom';
|
||||
import { NostrLoginProvider } from '@nostrify/react/login';
|
||||
import { NostrLoginProvider } from '@/lib/nostrLogin';
|
||||
import NostrProvider from '@/components/NostrProvider';
|
||||
import { AppProvider } from '@/components/AppProvider';
|
||||
import { NWCProvider } from '@/contexts/NWCContext';
|
||||
|
|
|
|||
Loading…
Reference in a new issue