Socket
Book a DemoInstallSign in
Socket

@github/auto-check-element

Package Overview
Dependencies
Maintainers
14
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@github/auto-check-element - npm Package Compare versions

Comparing version

to
5.1.0

3

dist/index.esm.js

@@ -116,3 +116,4 @@ function throttle(callback) {

get csrf() {
return this.getAttribute('csrf') || '';
const csrfElement = this.querySelector('[data-csrf]');
return this.getAttribute('csrf') || csrfElement instanceof HTMLInputElement && csrfElement.value || '';
}

@@ -119,0 +120,0 @@

@@ -122,3 +122,4 @@ (function (global, factory) {

get csrf() {
return this.getAttribute('csrf') || '';
const csrfElement = this.querySelector('[data-csrf]');
return this.getAttribute('csrf') || csrfElement instanceof HTMLInputElement && csrfElement.value || '';
}

@@ -125,0 +126,0 @@

{
"name": "@github/auto-check-element",
"version": "5.0.2",
"version": "5.1.0",
"description": "An input element that validates its value with a server endpoint.",

@@ -5,0 +5,0 @@ "repository": "github/auto-check-element",

@@ -23,2 +23,11 @@ # <auto-check> element

Note that in the following example the CSRF element is marked with the `data-csrf` attribute rather than `name` so that the value doesn't get posted to the backend when the element is placed in a form.
```erb
<auto-check src="/signup-check/username">
<input>
<input hidden data-csrf value="<%= authenticity_token_for("/signup-check/username") %>">
</auto-check>
```
## Attributes

@@ -28,2 +37,3 @@

- `csrf` is the [CSRF][] token for the posted form. It's available in the request body as a `authenticity_token` form parameter.
- You can also supply the CSRF token via a child element. See [usage](#Usage) example.
- `required` is a boolean attribute that requires the validation to succeed before the surrounding form may be submitted.

@@ -30,0 +40,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.