Sha256: 1cda8137d97cc9e92afdba1ec38e8e5e990e09115bd8ac43aca596646b0babb7
Contents?: true
Size: 774 Bytes
Versions: 12
Compression:
Stored size: 774 Bytes
Contents
Rev.registerComponent('AuthenticityToken', class AuthenticityToken extends React.Component { static get defaultProps() { return { name: 'authenticity_token', } } // Calculate the current csrf token by checking the prop override if it exists // and falling back to the latest app props if not // We check at render time like this (rather than using a default prop) // because the router can change the App.props after the class is // instantiated, but defaultProps never re-runs get value() { return this.props.value || (App.props.meta && App.props.meta['csrf-token']) || App.props.csrf_token } render() { return <input type="hidden" name={this.props.name} value={this.value} /> } })
Version data entries
12 entries across 12 versions & 1 rubygems