mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-10 00:52:11 +01:00
Added an another csrf token helper.
This commit is contained in:
parent
58411bdb7d
commit
4c6e02d07f
@ -18,6 +18,14 @@ Ref<HTTPSession> Request::get_or_create_session() {
|
||||
return session;
|
||||
}
|
||||
|
||||
bool Request::has_csrf_token() {
|
||||
if (!session.is_valid()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return session->has("csrf_token");
|
||||
}
|
||||
|
||||
String Request::get_csrf_token() {
|
||||
if (!session.is_valid()) {
|
||||
return "";
|
||||
|
@ -39,6 +39,8 @@ public:
|
||||
std::map<String, Ref<Reference> > reference_data;
|
||||
|
||||
Ref<HTTPSession> get_or_create_session();
|
||||
|
||||
bool has_csrf_token();
|
||||
String get_csrf_token();
|
||||
|
||||
virtual const String get_cookie(const String &key);
|
||||
|
Loading…
Reference in New Issue
Block a user