@korajs/auth 0.3.1 → 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 +5 -5
package/dist/server.js
CHANGED
|
@@ -815,14 +815,12 @@ var BuiltInAuthRoutes = class {
|
|
|
815
815
|
throw err;
|
|
816
816
|
}
|
|
817
817
|
const deviceId = body.deviceId ?? `device-${user.id}`;
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
});
|
|
825
|
-
}
|
|
818
|
+
await this.userStore.registerDevice({
|
|
819
|
+
id: deviceId,
|
|
820
|
+
userId: user.id,
|
|
821
|
+
publicKey: body.devicePublicKey ?? "",
|
|
822
|
+
name: body.deviceId ? "Primary Device" : "Browser"
|
|
823
|
+
});
|
|
826
824
|
const tokens = this.tokenManager.issueTokens(user.id, deviceId);
|
|
827
825
|
return {
|
|
828
826
|
status: 201,
|
|
@@ -872,14 +870,12 @@ var BuiltInAuthRoutes = class {
|
|
|
872
870
|
}
|
|
873
871
|
await this.rateLimiter.reset(rateLimitKey);
|
|
874
872
|
const deviceId = body.deviceId ?? `device-${storedUser.id}`;
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
});
|
|
882
|
-
}
|
|
873
|
+
await this.userStore.registerDevice({
|
|
874
|
+
id: deviceId,
|
|
875
|
+
userId: storedUser.id,
|
|
876
|
+
publicKey: body.devicePublicKey ?? "",
|
|
877
|
+
name: body.deviceId ? "Device" : "Browser"
|
|
878
|
+
});
|
|
883
879
|
const tokens = this.tokenManager.issueTokens(storedUser.id, deviceId);
|
|
884
880
|
const user = {
|
|
885
881
|
id: storedUser.id,
|