diff --git a/CHANGES.rst b/CHANGES.rst
index f124978e..e43c44e0 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -25,8 +25,9 @@ Fixes
- (:issue:`281`) Reset password can be exploited and other OWASP improvements.
- (:pr:`817`) Confirmation can be exploited and other OWASP improvements.
- (:pr:`819`) Convert to pyproject.toml, build, remove setup.
-- (:pr:`xxx`) the tf_validity feature now ONLY sets a cookie - and the token is no longer
+- (:pr:`823`) the tf_validity feature now ONLY sets a cookie - and the token is no longer
returned as part of a JSON response.
+- (:pr:`xxx`) Fix login/unified signin templates to properly send CSRF token. Add more tests.
Backwards Compatibility Concerns
+++++++++++++++++++++++++++++++++
diff --git a/docs/patterns.rst b/docs/patterns.rst
index 4af65afa..5544230e 100644
--- a/docs/patterns.rst
+++ b/docs/patterns.rst
@@ -251,7 +251,7 @@ Note that we use the header name ``X-CSRF-Token`` as that is one of the default
headers configured in Flask-WTF (*WTF_CSRF_HEADERS*)
To protect your application's endpoints (that presumably are not using Flask forms),
-you need to enable CSRF as described in the FlaskWTF `documentation `_: ::
+you need to enable CSRF as described in the FlaskWTF `documentation `_: ::
flask_wtf.CSRFProtect(app)
diff --git a/flask_security/oauth_glue.py b/flask_security/oauth_glue.py
index 444c106f..b814b562 100644
--- a/flask_security/oauth_glue.py
+++ b/flask_security/oauth_glue.py
@@ -4,7 +4,7 @@
Class and methods to glue our login path with authlib for to support 'social' auth.
- :copyright: (c) 2022-2022 by J. Christopher Wagner (jwag).
+ :copyright: (c) 2022-2023 by J. Christopher Wagner (jwag).
:license: MIT, see LICENSE for more details.
"""
@@ -23,6 +23,7 @@
from flask import abort, after_this_request, redirect, request
+from .decorators import unauth_csrf
from .proxies import _security
from .utils import (
config_value as cv,
@@ -73,6 +74,7 @@ def google_fetch_identity(
return "email", profile["email"]
+@unauth_csrf()
def oauthstart(name: str) -> "ResponseValue":
"""View to start an oauth authentication.
Name is a pre-registered oauth provider.
diff --git a/flask_security/templates/security/login_user.html b/flask_security/templates/security/login_user.html
index 0991a68b..2d254921 100644
--- a/flask_security/templates/security/login_user.html
+++ b/flask_security/templates/security/login_user.html
@@ -21,7 +21,7 @@
{{ _fsdomain('Login') }}
{{ _fsdomain("Use WebAuthn to Sign In") }}
-
@@ -31,8 +31,11 @@
{{ _fsdomain("Use WebAuthn to Sign In") }}
{{ _fsdomain("Use Social Oauth to Sign In") }}
{% for provider in security.oauthglue.provider_names %}