Skip to content

Commit

Permalink
get rid of httpmethod enum.
Browse files Browse the repository at this point in the history
  • Loading branch information
fiatjaf committed Aug 16, 2023
1 parent 45e479d commit bce976f
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions nip98.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,6 @@ import {
} from './event'
import {utf8Decoder, utf8Encoder} from './utils'

enum HttpMethod {
Get = 'get',
Head = 'head',
Post = 'post'
Put = 'put'
Delete = 'delete'
Connect = 'connect'
Options = 'options'
Trace = 'trace'
Patch = 'patch'
}

const _authorizationScheme = 'Nostr '

/**
Expand All @@ -31,16 +19,14 @@ const _authorizationScheme = 'Nostr '
*/
export async function getToken(
loginUrl: string,
httpMethod: HttpMethod | string,
httpMethod: string,
sign: <K extends number = number>(
e: EventTemplate<K>
) => Promise<Event<K>> | Event<K>,
includeAuthorizationScheme: boolean = false
): Promise<string> {
if (!loginUrl || !httpMethod)
throw new Error('Missing loginUrl or httpMethod')
if (!httpMethod in HttpMethod)
throw new Error('Unknown httpMethod')

const event = getBlankEvent(Kind.HttpAuth)

Expand Down

0 comments on commit bce976f

Please sign in to comment.