This commit is contained in:
parent
22f8eeebf2
commit
f670bd57f5
@ -114,12 +114,19 @@ export const AppBar = () => {
|
|||||||
<MenuItem
|
<MenuItem
|
||||||
sx={{
|
sx={{
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
display: { md: 'none', paddingBottom: 0, marginBottom: -10 }
|
display: { md: 'none' }
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Typography variant='h5'>{username}</Typography>
|
<Typography variant='h6'>{username}</Typography>
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem
|
||||||
|
onClick={handleProfile}
|
||||||
|
sx={{
|
||||||
|
justifyContent: 'center'
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Profile
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem onClick={handleProfile}>Profile</MenuItem>
|
|
||||||
<Link
|
<Link
|
||||||
to={appPublicRoutes.help}
|
to={appPublicRoutes.help}
|
||||||
target='_blank'
|
target='_blank'
|
||||||
@ -127,8 +134,7 @@ export const AppBar = () => {
|
|||||||
>
|
>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
sx={{
|
sx={{
|
||||||
justifyContent: 'center',
|
justifyContent: 'center'
|
||||||
borderTop: '0.5px solid var(--mui-palette-text-secondary)'
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Help
|
Help
|
||||||
@ -137,8 +143,7 @@ export const AppBar = () => {
|
|||||||
<MenuItem
|
<MenuItem
|
||||||
onClick={handleLogout}
|
onClick={handleLogout}
|
||||||
sx={{
|
sx={{
|
||||||
justifyContent: 'center',
|
justifyContent: 'center'
|
||||||
borderTop: '0.5px solid var(--mui-palette-text-secondary)'
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Logout
|
Logout
|
||||||
|
@ -243,10 +243,10 @@ export class NostrController {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const { private: secretKey } = keys
|
const { private: nsec } = keys
|
||||||
const nsec = new TextEncoder().encode(secretKey)
|
const privateKey = nip19.decode(nsec).data as Uint8Array
|
||||||
|
|
||||||
const signedEvent = finalizeEvent(event, nsec)
|
const signedEvent = finalizeEvent(event, privateKey)
|
||||||
|
|
||||||
verifySignedEvent(signedEvent)
|
verifySignedEvent(signedEvent)
|
||||||
|
|
||||||
|
@ -16,7 +16,6 @@ import {
|
|||||||
} from '../../store/actions'
|
} from '../../store/actions'
|
||||||
import { LoginMethods } from '../../store/auth/types'
|
import { LoginMethods } from '../../store/auth/types'
|
||||||
import { Dispatch } from '../../store/store'
|
import { Dispatch } from '../../store/store'
|
||||||
import { nsecToHex } from '../../utils'
|
|
||||||
import styles from './style.module.scss'
|
import styles from './style.module.scss'
|
||||||
import { useNavigate } from 'react-router-dom'
|
import { useNavigate } from 'react-router-dom'
|
||||||
|
|
||||||
@ -67,9 +66,10 @@ export const Login = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const loginWithNsec = async () => {
|
const loginWithNsec = async () => {
|
||||||
const hexPrivateKey = nsecToHex(inputValue)
|
const nsec = inputValue
|
||||||
|
const privateKey = nip19.decode(nsec).data as Uint8Array
|
||||||
|
|
||||||
if (!hexPrivateKey) {
|
if (!privateKey) {
|
||||||
toast.error(
|
toast.error(
|
||||||
'Snap, we failed to convert the private key you provided. Please make sure key is valid.'
|
'Snap, we failed to convert the private key you provided. Please make sure key is valid.'
|
||||||
)
|
)
|
||||||
@ -77,11 +77,11 @@ export const Login = () => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const publickey = getPublicKey(new TextEncoder().encode(hexPrivateKey))
|
const publickey = getPublicKey(privateKey)
|
||||||
|
|
||||||
dispatch(
|
dispatch(
|
||||||
updateKeyPair({
|
updateKeyPair({
|
||||||
private: hexPrivateKey,
|
private: nsec,
|
||||||
public: publickey
|
public: publickey
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
@ -136,8 +136,10 @@ export const ProfilePage = () => {
|
|||||||
className={styles.textField}
|
className={styles.textField}
|
||||||
disabled
|
disabled
|
||||||
type={isPassword ? 'password' : 'text'}
|
type={isPassword ? 'password' : 'text'}
|
||||||
|
InputProps={{
|
||||||
|
endAdornment: <ContentCopyIcon className={styles.copyItem} />
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<ContentCopyIcon className={styles.copyItem} />
|
|
||||||
</ListItem>
|
</ListItem>
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -224,7 +226,9 @@ export const ProfilePage = () => {
|
|||||||
{editItem('about', 'About', true, 4)}
|
{editItem('about', 'About', true, 4)}
|
||||||
{isUsersOwnProfile && (
|
{isUsersOwnProfile && (
|
||||||
<>
|
<>
|
||||||
{keys && keys.public && copyItem(keys.public, 'Public Key')}
|
{keys &&
|
||||||
|
keys.public &&
|
||||||
|
copyItem(nip19.npubEncode(keys.public), 'Public Key')}
|
||||||
{keys &&
|
{keys &&
|
||||||
keys.private &&
|
keys.private &&
|
||||||
copyItem(
|
copyItem(
|
||||||
|
Loading…
Reference in New Issue
Block a user