Search Results for

    Show / Hide Table of Contents
    View Source

    Interface IPreviewTokenGenerator

    Generates and verifies preview tokens for content preview functionality.

    Namespace: Umbraco.Cms.Core.Preview
    Assembly: Umbraco.Core.dll
    Syntax
    public interface IPreviewTokenGenerator
    Remarks

    Preview tokens allow users to preview unpublished content by generating secure, time-limited tokens that can be verified on subsequent requests.

    Methods

    View Source

    GenerateTokenAsync(Guid)

    Generates a preview token for the specified user.

    Declaration
    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
    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