Compare commits
3 Commits
v0.1.0-dev
...
v0.1.0-dev
Author | SHA1 | Date |
---|---|---|
semantic-release-bot | 7aed936a0b | |
Derrick Hammer | ccce11d34d | |
Derrick Hammer | dfe87396b9 |
|
@ -1,3 +1,10 @@
|
|||
# [0.1.0-develop.18](https://git.lumeweb.com/LumeWeb/sdk/compare/v0.1.0-develop.17...v0.1.0-develop.18) (2023-10-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* only use the private key, not extended ([dfe8739](https://git.lumeweb.com/LumeWeb/sdk/commit/dfe87396b9770a8c37d22bd7d30c0904bd16082c))
|
||||
|
||||
# [0.1.0-develop.17](https://git.lumeweb.com/LumeWeb/sdk/compare/v0.1.0-develop.16...v0.1.0-develop.17) (2023-10-12)
|
||||
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@lumeweb/sdk",
|
||||
"version": "0.1.0-develop.17",
|
||||
"version": "0.1.0-develop.18",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@lumeweb/sdk",
|
||||
"version": "0.1.0-develop.17",
|
||||
"version": "0.1.0-develop.18",
|
||||
"dependencies": {
|
||||
"@lumeweb/kernel-network-registry-client": "0.1.0-develop.10",
|
||||
"@lumeweb/libkernel": "0.1.0-develop.65",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@lumeweb/sdk",
|
||||
"version": "0.1.0-develop.17",
|
||||
"version": "0.1.0-develop.18",
|
||||
"type": "module",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/src/index.d.ts",
|
||||
|
|
|
@ -6,22 +6,26 @@ import {
|
|||
import { useLume } from "../LumeProvider";
|
||||
import React, { useContext } from "react";
|
||||
|
||||
export const LumeIdentityContext = React.createContext<{open: boolean, setOpen: (open: boolean) => void} | undefined>(undefined);
|
||||
export const LumeIdentityContext = React.createContext<
|
||||
{ open: boolean; setOpen: (open: boolean) => void } | undefined
|
||||
>(undefined);
|
||||
|
||||
export function useLumeIndentity() {
|
||||
const {isLoggedIn, setIsLoggedIn} = useLume();
|
||||
const ctx = useContext(LumeIdentityContext);
|
||||
const { isLoggedIn, setIsLoggedIn } = useLume();
|
||||
const ctx = useContext(LumeIdentityContext);
|
||||
|
||||
if(!ctx) {
|
||||
throw new Error("useLumeIdentity should be used inside LumeIdentityContext.Provider")
|
||||
if (!ctx) {
|
||||
throw new Error(
|
||||
"useLumeIdentity should be used inside LumeIdentityContext.Provider",
|
||||
);
|
||||
}
|
||||
|
||||
const {setOpen} = ctx;
|
||||
const { setOpen } = ctx;
|
||||
|
||||
return {
|
||||
isSignedIn: isLoggedIn,
|
||||
async signIn(key: Uint8Array) {
|
||||
await login(key);
|
||||
await login(key.slice(0, 32));
|
||||
// await loginComplete(); # this function is buggy `auth.ts:42 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'promise') `
|
||||
setIsLoggedIn(true);
|
||||
setOpen(false);
|
||||
|
|
Loading…
Reference in New Issue