Skip to content

Commit

Permalink
fix(facade): remove deprecated dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Vilsol committed Nov 20, 2024
1 parent 4ab2e7e commit 97ff4f2
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 30 deletions.
117 changes: 92 additions & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/facade/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"request-ip": "^3.3.0",
"rxjs": "^7.8.1",
"ts-proto-descriptors": "2.0.0",
"useragent": "^2.3.0",
"ua-parser-js": "^2.0.0",
"uuid": "11.0.2",
"winston": "^3.9.0",
"ws": "^8.17.0"
Expand Down
8 changes: 4 additions & 4 deletions packages/facade/src/modules/identity/oidc/password-grant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
type LoginFnResponse
} from './interfaces.js';
import { nanoid, epochTime } from './utils.js';
import * as useragent from 'useragent';
import { UAParser } from 'ua-parser-js';
import * as uuid from 'uuid';
import * as requestIp from 'request-ip';
import {
Expand Down Expand Up @@ -129,10 +129,10 @@ export const registerPasswordGrantType = (config: OIDCPasswordGrantTypeConfig) =
}
const req = ctx.request;
let os, agentName;
const agent = useragent.parse(req.headers['user-agent']);
const agent = new UAParser(req.headers['user-agent']);
if (agent) {
os = agent.os.toString();
agentName = agent.toAgent();
os = agent.getOS().toString();
agentName = agent.getUA();
}

ctx.body = await performPasswordGrant(ctx, client.clientId, body.identifier, passwordValue, key);
Expand Down

0 comments on commit 97ff4f2

Please sign in to comment.