Search Results for

    Show / Hide Table of Contents
    View Source

    Class NoopPreviewTokenGenerator

    A no-operation implementation of IPreviewTokenGenerator that always fails.

    Inheritance
    object
    Namespace: Umbraco.Cms.Core.Preview
    Assembly: Umbraco.Core.dll
    Syntax
    public class NoopPreviewTokenGenerator : IPreviewTokenGenerator
    Remarks

    This implementation is used as a placeholder when preview functionality is not configured or available. All operations return failed attempts.

    Constructors

    View Source

    NoopPreviewTokenGenerator()

    Declaration
    public NoopPreviewTokenGenerator()

    Methods

    View Source

    GenerateTokenAsync(Guid)

    Generates a preview token for the specified user.

    Declaration
    public Task<Attempt<string?>> GenerateTokenAsync(Guid userKey)
    Parameters
    Type Name Description
    Guid userKey

    The unique key of the user requesting the preview token.

    Returns
    Type Description
    Task<Attempt<string>>

    An attempt containing the generated token string on success, or a failure result.

    View Source

    VerifyAsync(string)

    Verifies a preview token and returns the associated user key.

    Declaration
    public Task<Attempt<Guid?>> VerifyAsync(string token)
    Parameters
    Type Name Description
    string token

    The preview token to verify.

    Returns
    Type Description
    Task<Attempt<Guid?>>

    An attempt containing the user key on success, or a failure result if the token is invalid or expired.

    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX