我正在使用react和spring安全性,並且想在用戶單擊註銷按鈕時傳遞csrf令牌。任何建議如何在反應中包含csrf標記。我在谷歌搜索解決方案,但沒有得到任何解決方案。響應路由器中的csrf令牌
import React from 'react';
import { IndexLink, Link } from 'react-router';
const Nav = (props) => (
<nav className="navbar navbar-inverse navbar-fixed-top">
<div className="container-fluid">
<div className="navbar-header">
<a className="navbar-brand" href="#">GoRFQ </a>
</div>
<ul className="nav navbar-nav">
<li ><Link onlyActiveOnIndex activeStyle={{color:'#052426'}} to='/'>Home</Link></li>
<li ><Link activeStyle={{color:'#052426'}} to='/boms'>BOMs</Link></li>
<li class="dropdown"><a href="javascript:void(0)" class="dropbtn">Quotes</a>
<div class="dropdown-content">
<Link activeStyle={{color:'#052426'}} to='/quotesin' >Incoming Quotes</Link>
<Link activeStyle={{color:'#052426'}} to='/quotesout' >Outgoing Quotes</Link>
</div>
</li>
<li class="dropdown"><a href="javascript:void(0)" class="dropbtn">Requests</a>
<div class="dropdown-content">
<Link activeStyle={{color:'#052426'}} to='/requestsin' >Received Requests</Link>
<Link activeStyle={{color:'#052426'}} to='/requestsout' >Sent Requests</Link>
</div>
</li>
<li ><Link activeStyle={{color:'#052426'}} to='/upload'>Upload BOM</Link></li>
<li ><Link activeStyle={{color:'#052426'}} to='/contacts'>Contacts</Link></li>
<li ><Link activeStyle={{color:'#052426'}} to='/profile'>My Profile</Link></li>
<li ><Link activeStyle={{color:'#052426'}} to='/about'>About</Link></li>
</ul>
<form action="/perform-logout" method="post" className="pull-right">
<input type="submit" className="btn btn-primary" value="Sign Out"/>
</form>
</div>
</nav>
);
export default Nav;
– elmeister
我嘗試過,但它不工作。收到此錯誤 未捕獲的ReferenceError:CSRF是不是在我的安全配置定義 – Asif