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 SourceNoopPreviewTokenGenerator()
Declaration
public NoopPreviewTokenGenerator()
Methods
View SourceGenerateTokenAsync(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. |
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. |