fix(routes/api): upgrade handlers to fit new fresh api
This commit is contained in:
parent
4fc24173ae
commit
a0b3a97ec6
|
|
@ -5,7 +5,7 @@ import { SessionHandlers } from ':src/session/mod.ts'
|
||||||
import { respondApi, respondApiStream } from ':src/utils.ts'
|
import { respondApi, respondApiStream } from ':src/utils.ts'
|
||||||
|
|
||||||
export const handler: SessionHandlers = {
|
export const handler: SessionHandlers = {
|
||||||
GET(_req, ctx) {
|
GET(ctx) {
|
||||||
try {
|
try {
|
||||||
const memberList = dbToMemberCardProps(db)
|
const memberList = dbToMemberCardProps(db)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,8 @@ export type WebAuthnLoginStartPayload = {
|
||||||
export type WebAuthnLoginFinishPayload = AuthenticationResponseJSON
|
export type WebAuthnLoginFinishPayload = AuthenticationResponseJSON
|
||||||
|
|
||||||
export const handler: SessionHandlers = {
|
export const handler: SessionHandlers = {
|
||||||
async POST(req, ctx) {
|
async POST(ctx) {
|
||||||
|
const req = ctx.req
|
||||||
const relyingParty = getRelyingParty(ctx.url)
|
const relyingParty = getRelyingParty(ctx.url)
|
||||||
|
|
||||||
const { step } = ctx.params as Params
|
const { step } = ctx.params as Params
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,8 @@ export type WebAuthnRegisterStartPayload = { name: string }
|
||||||
export type WebAuthnRegisterFinishPayload = RegistrationResponseJSON
|
export type WebAuthnRegisterFinishPayload = RegistrationResponseJSON
|
||||||
|
|
||||||
export const handler: SessionHandlers = {
|
export const handler: SessionHandlers = {
|
||||||
async POST(req, ctx) {
|
async POST(ctx) {
|
||||||
|
const req = ctx.req
|
||||||
const relyingParty = getRelyingParty(ctx.url)
|
const relyingParty = getRelyingParty(ctx.url)
|
||||||
|
|
||||||
const { step } = ctx.params as Params
|
const { step } = ctx.params as Params
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import { define } from '../../../utils.ts'
|
||||||
|
|
||||||
export const handler = define.handlers({
|
export const handler = define.handlers({
|
||||||
GET() {
|
GET() {
|
||||||
console.log('VAPID', publicKey)
|
|
||||||
return respondApi('success', publicKey)
|
return respondApi('success', publicKey)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue