mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2025-08-27 04:59:22 +00:00
Add comments to useLoginActions
This commit is contained in:
parent
3c5e6803b4
commit
4f2fadfcde
@ -1,19 +1,24 @@
|
||||
import { useNostr } from '@nostrify/react';
|
||||
import { NLogin, useNostrLogin } from '@nostrify/react/login';
|
||||
|
||||
// NOTE: This file should not be edited except for adding new login methods.
|
||||
|
||||
export function useLoginActions() {
|
||||
const { nostr } = useNostr();
|
||||
const { addLogin } = useNostrLogin();
|
||||
|
||||
return {
|
||||
// Login with a Nostr secret key
|
||||
nsec(nsec: string): void {
|
||||
const login = NLogin.fromNsec(nsec);
|
||||
addLogin(login);
|
||||
},
|
||||
// Login with a NIP-46 "bunker://" URI
|
||||
async bunker(uri: string): Promise<void> {
|
||||
const login = await NLogin.fromBunker(uri, nostr);
|
||||
addLogin(login);
|
||||
},
|
||||
// Login with a NIP-07 browser extension
|
||||
async extension(): Promise<void> {
|
||||
const login = await NLogin.fromExtension();
|
||||
addLogin(login);
|
||||
|
Loading…
x
Reference in New Issue
Block a user