Skip to content

AuthorizationExtensions.ValidateLoggedIn method

Ensures a user is currently authenticated, throwing a validation error with code NotLoggedIn otherwise.

public static void ValidateLoggedIn(this IUserAccessor? userAccessor, ITextLocalizer? localizer)
parameter description
userAccessor The accessor that provides the current user.
localizer The localizer used to produce the error message.

Exceptions

exception condition
ValidationError No user is currently authenticated.

See Also