Skip to content

Commit

Permalink
fix dbScope の型を外に
Browse files Browse the repository at this point in the history
  • Loading branch information
a01sa01to committed Nov 8, 2024
1 parent 646de03 commit 0c48051
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions webapp/api/oauth/authorize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ import {

const app = new Hono<HonoEnv>()

interface IDbScope {
oauth_scope: {
id: number
name: string
description: string | null
} | null
oauth_client_scope: {
client_id: string
scope_id: number
}
}

// 仕様はここ参照: https://github.com/saitamau-maximum/auth/issues/27

app.get(
Expand Down Expand Up @@ -140,17 +152,7 @@ app.get(
return errorRedirect('invalid_scope', 'invalid scope', '')
}

let dbScopes: {
oauth_scope: {
id: number
name: string
description: string | null
} | null
oauth_client_scope: {
client_id: string
scope_id: number
}
}[]
let dbScopes: IDbScope[]

if (!scope) {
dbScopes = await c.var.dbClient
Expand Down

0 comments on commit 0c48051

Please sign in to comment.