@flink-app/oidc-plugin 2.0.0-alpha.73 → 2.0.0-alpha.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/README.md +2 -2
- package/dist/handlers/CallbackOidc.js +1 -1
- package/examples/multi-provider.ts +1 -1
- package/package.json +6 -6
- package/src/handlers/CallbackOidc.ts +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -500,7 +500,7 @@ onAuthSuccess: async ({ profile, claims }, ctx) => {
|
|
|
500
500
|
subject: claims.sub,
|
|
501
501
|
provider: "acme",
|
|
502
502
|
});
|
|
503
|
-
await ctx.repos.userRepo.
|
|
503
|
+
await ctx.repos.userRepo.updateById(user._id, {
|
|
504
504
|
oidcConnections: user.oidcConnections,
|
|
505
505
|
});
|
|
506
506
|
} else {
|
|
@@ -552,7 +552,7 @@ onAuthSuccess: async ({ profile, claims }, ctx) => {
|
|
|
552
552
|
});
|
|
553
553
|
} else {
|
|
554
554
|
// Update roles on each login
|
|
555
|
-
await ctx.repos.userRepo.
|
|
555
|
+
await ctx.repos.userRepo.updateById(user._id, { roles });
|
|
556
556
|
}
|
|
557
557
|
|
|
558
558
|
const token = await ctx.plugins.jwtAuth.createToken({ userId: user._id }, roles);
|
|
@@ -155,7 +155,7 @@ const CallbackOidc = async ({ ctx, req }) => {
|
|
|
155
155
|
// Create or update OIDC connection
|
|
156
156
|
const existingConnection = await ctx.repos.oidcConnectionRepo.findByUserAndProvider(user._id, provider);
|
|
157
157
|
if (existingConnection) {
|
|
158
|
-
await ctx.repos.oidcConnectionRepo.
|
|
158
|
+
await ctx.repos.oidcConnectionRepo.updateById(existingConnection._id, {
|
|
159
159
|
accessToken: encryptedAccessToken,
|
|
160
160
|
idToken: encryptedIdToken,
|
|
161
161
|
refreshToken: encryptedRefreshToken,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flink-app/oidc-plugin",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.74",
|
|
4
4
|
"description": "Flink plugin for OIDC authentication with generic IdP support",
|
|
5
5
|
"author": "joel@frost.se",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"openid-client": "^5.7.0",
|
|
14
|
-
"@flink-app/jwt-auth-plugin": "2.0.0-alpha.
|
|
14
|
+
"@flink-app/jwt-auth-plugin": "2.0.0-alpha.74"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"@flink-app/flink": ">=2.0.0-alpha.
|
|
17
|
+
"@flink-app/flink": ">=2.0.0-alpha.74",
|
|
18
18
|
"mongodb": "^6.15.0"
|
|
19
19
|
},
|
|
20
20
|
"peerDependenciesMeta": {
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"@types/node": "22.13.10",
|
|
28
28
|
"ts-node": "^10.9.2",
|
|
29
29
|
"tsc-watch": "^4.2.9",
|
|
30
|
-
"@flink-app/flink": "2.0.0-alpha.
|
|
31
|
-
"@flink-app/
|
|
32
|
-
"@flink-app/
|
|
30
|
+
"@flink-app/flink": "2.0.0-alpha.74",
|
|
31
|
+
"@flink-app/test-utils": "2.0.0-alpha.74",
|
|
32
|
+
"@flink-app/jwt-auth-plugin": "2.0.0-alpha.74"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"test": "jasmine-ts --config=./spec/support/jasmine.json",
|
|
@@ -190,7 +190,7 @@ const CallbackOidc: GetHandler<any, any, PathParams, CallbackRequest> = async ({
|
|
|
190
190
|
const existingConnection = await ctx.repos.oidcConnectionRepo.findByUserAndProvider(user._id, provider);
|
|
191
191
|
|
|
192
192
|
if (existingConnection) {
|
|
193
|
-
await ctx.repos.oidcConnectionRepo.
|
|
193
|
+
await ctx.repos.oidcConnectionRepo.updateById(existingConnection._id!, {
|
|
194
194
|
accessToken: encryptedAccessToken,
|
|
195
195
|
idToken: encryptedIdToken,
|
|
196
196
|
refreshToken: encryptedRefreshToken,
|