fix: reverting signing of nostr auth token
This commit is contained in:
parent
5e114f7fb8
commit
38913e770d
@ -40,6 +40,20 @@ export class AuthController {
|
|||||||
console.error('Error occurred while finding metadata', err)
|
console.error('Error occurred while finding metadata', err)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Nostr uses unix timestamps
|
||||||
|
const timestamp = Math.floor(Date.now() / 1000)
|
||||||
|
const { hostname } = window.location
|
||||||
|
|
||||||
|
const authEvent: EventTemplate = {
|
||||||
|
kind: 1,
|
||||||
|
tags: [],
|
||||||
|
content: `${hostname}-${timestamp}`,
|
||||||
|
created_at: timestamp
|
||||||
|
}
|
||||||
|
|
||||||
|
const signedAuthEvent = await this.nostrController.signEvent(authEvent)
|
||||||
|
this.createAndSaveAuthToken(signedAuthEvent)
|
||||||
|
|
||||||
store.dispatch(
|
store.dispatch(
|
||||||
setAuthState({
|
setAuthState({
|
||||||
loggedIn: true,
|
loggedIn: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user