@korajs/auth 0.3.2 → 0.3.3
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/dist/server.cjs +12 -16
- package/dist/server.cjs.map +1 -1
- package/dist/server.js +12 -16
- package/dist/server.js.map +1 -1
- package/package.json +2 -2
package/dist/server.cjs
CHANGED
|
@@ -1141,14 +1141,12 @@ var BuiltInAuthRoutes = class {
|
|
|
1141
1141
|
throw err;
|
|
1142
1142
|
}
|
|
1143
1143
|
const deviceId = body.deviceId ?? `device-${user.id}`;
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
});
|
|
1151
|
-
}
|
|
1144
|
+
await this.userStore.registerDevice({
|
|
1145
|
+
id: deviceId,
|
|
1146
|
+
userId: user.id,
|
|
1147
|
+
publicKey: body.devicePublicKey ?? "",
|
|
1148
|
+
name: body.deviceId ? "Primary Device" : "Browser"
|
|
1149
|
+
});
|
|
1152
1150
|
const tokens = this.tokenManager.issueTokens(user.id, deviceId);
|
|
1153
1151
|
return {
|
|
1154
1152
|
status: 201,
|
|
@@ -1198,14 +1196,12 @@ var BuiltInAuthRoutes = class {
|
|
|
1198
1196
|
}
|
|
1199
1197
|
await this.rateLimiter.reset(rateLimitKey);
|
|
1200
1198
|
const deviceId = body.deviceId ?? `device-${storedUser.id}`;
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
});
|
|
1208
|
-
}
|
|
1199
|
+
await this.userStore.registerDevice({
|
|
1200
|
+
id: deviceId,
|
|
1201
|
+
userId: storedUser.id,
|
|
1202
|
+
publicKey: body.devicePublicKey ?? "",
|
|
1203
|
+
name: body.deviceId ? "Device" : "Browser"
|
|
1204
|
+
});
|
|
1209
1205
|
const tokens = this.tokenManager.issueTokens(storedUser.id, deviceId);
|
|
1210
1206
|
const user = {
|
|
1211
1207
|
id: storedUser.id,
|