mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2025-05-06 17:51:36 +02: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;
|
return session;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Request::has_csrf_token() {
|
||||||
|
if (!session.is_valid()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return session->has("csrf_token");
|
||||||
|
}
|
||||||
|
|
||||||
String Request::get_csrf_token() {
|
String Request::get_csrf_token() {
|
||||||
if (!session.is_valid()) {
|
if (!session.is_valid()) {
|
||||||
return "";
|
return "";
|
||||||
|
@ -39,6 +39,8 @@ public:
|
|||||||
std::map<String, Ref<Reference> > reference_data;
|
std::map<String, Ref<Reference> > reference_data;
|
||||||
|
|
||||||
Ref<HTTPSession> get_or_create_session();
|
Ref<HTTPSession> get_or_create_session();
|
||||||
|
|
||||||
|
bool has_csrf_token();
|
||||||
String get_csrf_token();
|
String get_csrf_token();
|
||||||
|
|
||||||
virtual const String get_cookie(const String &key);
|
virtual const String get_cookie(const String &key);
|
||||||
|
Loading…
Reference in New Issue
Block a user