-
Notifications
You must be signed in to change notification settings - Fork 9.9k
/
AntiforgeryRequestToken.cs
34 lines (29 loc) · 1.07 KB
/
AntiforgeryRequestToken.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace Microsoft.AspNetCore.Components.Forms;
/// <summary>
/// The antiforgery token included in the request form data.
/// </summary>
public class AntiforgeryRequestToken
{
/// <summary>
/// Initializes a new instance of <see cref="AntiforgeryRequestToken"/>.
/// </summary>
/// <param name="value">The antiforgery token value.</param>
/// <param name="formFieldName">The form field name for the antiforgery token.</param>
public AntiforgeryRequestToken(string value, string formFieldName)
{
ArgumentNullException.ThrowIfNull(value);
ArgumentNullException.ThrowIfNull(formFieldName);
Value = value;
FormFieldName = formFieldName;
}
/// <summary>
/// Gets the antiforgery token value.
/// </summary>
public string Value { get; }
/// <summary>
/// Gets the form field name for the antiforgery token.
/// </summary>
public string FormFieldName { get; }
}