From 5e81dc90e4d250e534081b2c9f03c7cfe092cc90 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 2 Nov 2023 10:08:58 +0100 Subject: [PATCH] add js docs to isUserCurrentUser method --- src/Umbraco.Web.UI.Client/src/shared/auth/auth.context.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Umbraco.Web.UI.Client/src/shared/auth/auth.context.ts b/src/Umbraco.Web.UI.Client/src/shared/auth/auth.context.ts index ad8db497da..bd2f8f578c 100644 --- a/src/Umbraco.Web.UI.Client/src/shared/auth/auth.context.ts +++ b/src/Umbraco.Web.UI.Client/src/shared/auth/auth.context.ts @@ -69,6 +69,12 @@ export class UmbAuthContext implements IUmbAuth { return this.#authFlow.signOut(); } + /** + * Checks if a user is the current user. + * + * @param userId The user id to check + * @returns True if the user is the current user, otherwise false + */ async isUserCurrentUser(userId: string): Promise { const currentUser = await firstValueFrom(this.currentUser); return currentUser?.id === userId;