Skip to content

Commit

Permalink
OAuth 클라이언트 각종 버그 수정 (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
tirr-c authored Jul 30, 2023
1 parent c80734a commit bd71c34
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/model/oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Transaction from './transaction'

export default class OAuth {
public async getClientById(tr: Transaction, id: string): Promise<AllClientMetadata> {
const client = await tr.query('SELECT client_id, client_secret, client_name FROM oauth_client WHERE client_id = $1', [id])
const client = await tr.query('SELECT client_id, client_secret, client_name FROM oauth_clients WHERE client_id = $1', [id])
const redirectUri = await tr.query('SELECT redirect_uri FROM oauth_client_redirect_uris WHERE client_id = $1', [id])
if (client.rows.length !== 1) {
throw new NoSuchEntryError()
Expand All @@ -17,11 +17,12 @@ export default class OAuth {
client_secret: client.rows[0].client_secret,
client_name: client.rows[0].client_name,
redirect_uris: redirectUri.rows.map(row => row.redirect_uri),
id_token_signed_response_alg: 'ES256',
}
}

public async isFirstParty(tr: Transaction, id: string): Promise<boolean> {
const result = await tr.query('SELECT first_party FROM oauth_client WHERE client_id = $1', [id])
const result = await tr.query('SELECT first_party FROM oauth_clients WHERE client_id = $1', [id])
return Boolean(result.rows[0]?.first_party)
}
}

0 comments on commit bd71c34

Please sign in to comment.