issue-38 #62

Closed
y wants to merge 48 commits from issue-38 into main
Showing only changes of commit 7db7e5de9e - Show all commits

View File

@ -45,6 +45,20 @@ export class AuthController {
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(
setAuthState({
loggedIn: true,