feat(api,front): expose the sub OIDC field for the frontend

Useful for E2EE encryption identification.

Signed-off-by: Raito Bezarius <[email protected]>
This commit is contained in:
Raito Bezarius
2024-09-12 16:42:58 +02:00
parent 152e7b1426
commit c7439be1a5
2 changed files with 4 additions and 2 deletions
+2 -2
View File
@@ -16,8 +16,8 @@ class UserSerializer(serializers.ModelSerializer):
class Meta:
model = models.User
fields = ["id", "email"]
read_only_fields = ["id", "email"]
fields = ["id", "sub", "email"]
read_only_fields = ["id", "sub", "email"]
class BaseAccessSerializer(serializers.ModelSerializer):
@@ -2,10 +2,12 @@
* Represents user retrieved from the API.
* @interface User
* @property {string} id - The id of the user.
* @property {string} sub - The `sub` field of OIDC
* @property {string} email - The email of the user.
* @property {string} name - The name of the user.
*/
export interface User {
id: string;
sub: string;
email: string;
}