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

Version Path
revelry_core-0.1.24.0 app/assets/javascripts/revelry/ui/forms/AuthenticityToken.es6
revelry_core-0.1.23.0 app/assets/javascripts/revelry/ui/forms/AuthenticityToken.es6
revelry_core-0.1.22.0 app/assets/javascripts/revelry/ui/forms/AuthenticityToken.es6
revelry_core-0.1.21.0 app/assets/javascripts/revelry/ui/forms/AuthenticityToken.es6
revelry_core-0.1.20.0 app/assets/javascripts/revelry/ui/forms/AuthenticityToken.es6
revelry_core-0.1.19.0 app/assets/javascripts/revelry/ui/forms/AuthenticityToken.es6
revelry_core-0.1.18.0 app/assets/javascripts/revelry/ui/forms/AuthenticityToken.es6
revelry_core-0.1.17.0 app/assets/javascripts/revelry/ui/forms/AuthenticityToken.es6
revelry_core-0.1.16.0 app/assets/javascripts/revelry/ui/forms/AuthenticityToken.es6
revelry_core-0.1.15.0 app/assets/javascripts/revelry/ui/forms/AuthenticityToken.es6
revelry_core-0.1.14.0 app/assets/javascripts/revelry/ui/forms/AuthenticityToken.es6
revelry_core-0.1.13.0 app/assets/javascripts/revelry/ui/forms/AuthenticityToken.es6