chore: little cleanup
Signed-off-by: benjdlambert <ben@blam.sh> Signed-off-by: benjdlambert <ben@blam.sh>
This commit is contained in:
@@ -106,18 +106,7 @@ export class OidcDatabase {
|
||||
|
||||
async createClient(client: Omit<Client, 'createdAt'>) {
|
||||
const now = DateTime.now().toString();
|
||||
console.log({
|
||||
client_id: client.clientId,
|
||||
client_secret: client.clientSecret,
|
||||
client_name: client.clientName,
|
||||
created_at: now,
|
||||
expires_at: client.expiresAt,
|
||||
response_types: JSON.stringify(client.responseTypes),
|
||||
grant_types: JSON.stringify(client.grantTypes),
|
||||
redirect_uris: JSON.stringify(client.redirectUris),
|
||||
scope: client.scope,
|
||||
metadata: JSON.stringify(client.metadata),
|
||||
});
|
||||
|
||||
await this.db<OidcClientRow>('oidc_clients').insert({
|
||||
client_id: client.clientId,
|
||||
client_secret: client.clientSecret,
|
||||
|
||||
@@ -144,7 +144,13 @@ export class OidcRouter {
|
||||
grantType,
|
||||
});
|
||||
|
||||
return res.json(result);
|
||||
return res.json({
|
||||
access_token: result.accessToken,
|
||||
token_type: result.tokenType,
|
||||
expires_in: result.expiresIn,
|
||||
id_token: result.idToken,
|
||||
scope: result.scope,
|
||||
});
|
||||
} catch (error) {
|
||||
const description = isError(error) ? error.message : 'Unknown error';
|
||||
this.logger.error(
|
||||
|
||||
@@ -284,10 +284,10 @@ export class OidcService {
|
||||
});
|
||||
|
||||
return {
|
||||
access_token: token,
|
||||
token_type: 'Bearer',
|
||||
expires_in: 3600,
|
||||
id_token: token,
|
||||
accessToken: token,
|
||||
tokenType: 'Bearer',
|
||||
expiresIn: 3600,
|
||||
idToken: token,
|
||||
scope: authCode.scope || 'openid',
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user