Compare commits

...

3 Commits

Author SHA1 Message Date
semantic-release-bot 7aed936a0b chore(release): 0.1.0-develop.18 [skip ci]
# [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](dfe87396b9))
2023-10-12 09:03:56 +00:00
Derrick Hammer ccce11d34d
Merge remote-tracking branch 'origin/develop' into develop 2023-10-12 05:02:38 -04:00
Derrick Hammer dfe87396b9
fix: only use the private key, not extended 2023-10-12 05:02:33 -04:00
4 changed files with 21 additions and 10 deletions

View File

@ -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) # [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)

4
npm-shrinkwrap.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "@lumeweb/sdk", "name": "@lumeweb/sdk",
"version": "0.1.0-develop.17", "version": "0.1.0-develop.18",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@lumeweb/sdk", "name": "@lumeweb/sdk",
"version": "0.1.0-develop.17", "version": "0.1.0-develop.18",
"dependencies": { "dependencies": {
"@lumeweb/kernel-network-registry-client": "0.1.0-develop.10", "@lumeweb/kernel-network-registry-client": "0.1.0-develop.10",
"@lumeweb/libkernel": "0.1.0-develop.65", "@lumeweb/libkernel": "0.1.0-develop.65",

View File

@ -1,6 +1,6 @@
{ {
"name": "@lumeweb/sdk", "name": "@lumeweb/sdk",
"version": "0.1.0-develop.17", "version": "0.1.0-develop.18",
"type": "module", "type": "module",
"main": "lib/index.js", "main": "lib/index.js",
"types": "lib/src/index.d.ts", "types": "lib/src/index.d.ts",

View File

@ -6,22 +6,26 @@ import {
import { useLume } from "../LumeProvider"; import { useLume } from "../LumeProvider";
import React, { useContext } from "react"; 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() { export function useLumeIndentity() {
const {isLoggedIn, setIsLoggedIn} = useLume(); const { isLoggedIn, setIsLoggedIn } = useLume();
const ctx = useContext(LumeIdentityContext); const ctx = useContext(LumeIdentityContext);
if(!ctx) { if (!ctx) {
throw new Error("useLumeIdentity should be used inside LumeIdentityContext.Provider") throw new Error(
"useLumeIdentity should be used inside LumeIdentityContext.Provider",
);
} }
const {setOpen} = ctx; const { setOpen } = ctx;
return { return {
isSignedIn: isLoggedIn, isSignedIn: isLoggedIn,
async signIn(key: Uint8Array) { 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') ` // await loginComplete(); # this function is buggy `auth.ts:42 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'promise') `
setIsLoggedIn(true); setIsLoggedIn(true);
setOpen(false); setOpen(false);