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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user