next-auth-pubkey
Version:
A light-weight Lightning and Nostr auth provider for your Next.js app that's entirely self-hosted and plugs seamlessly into the next-auth framework.
21 lines • 1.11 kB
TypeScript
import { NextAuthPubkeyClientSession } from "../server/index.js";
/**
* A React hook that, on mount, will poll the API and checks if the Lightning auth QR has been scanned.
* If enough time elapses without a sign in attempt, the page will be refreshed.
* Once a success status is received from polling, the user will be redirected to the `next-auth` redirect url.
*
* This hook is designed for use in both the pages router and the app router.
*
* @param {object} session - a session object generated by invoking the `createLightningAuth` method
*
* @returns {Object}
* @returns {String} lnurl - the raw LNURL, should be made available for copy-pasting
* @returns {String} qr - a url pointing the lnurl-auth QR Code image, should be used in the src prop of img tags
* @returns {String} button - a deep-link that will open in Lightning enabled wallets, should be used in the href prop of anchor tags
*/
export declare function useLightningPolling(session: NextAuthPubkeyClientSession): {
lnurl: string | null;
qr: string;
button: string;
};
//# sourceMappingURL=useLightningPolling.d.ts.map