Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix /api/session/ preloading (attempt no2) #992

Merged
merged 1 commit into from Sep 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion agir/front/components/allPages/SWRContext.js
Expand Up @@ -7,8 +7,9 @@ import axios from "@agir/lib/utils/axios";
const fetcher = async (url) => {
if (url === "/api/session/") {
const res = await fetch(url, {
method: "GET",
credentials: "include",
mode: "no-cors",
headers: { Accept: "*/*" },
});
return res.json();
}
Expand Down
2 changes: 1 addition & 1 deletion agir/front/templates/front/react_view.html
@@ -1,7 +1,7 @@
{% extends "front/base_layout.html" %}

{% block additional_headers %}
<link rel="preload" href="{% url "api_session" %}" as="fetch" type="application/json">
<link rel="preload" href="{% url "api_session" %}" as="fetch" type="application/json"></link>
{% endblock %}

{% block whole_page %}
Expand Down