Skip to content

Commit 55b6a15

Browse files
erezrokaherquhart
authored andcommitted
fix: don't open modal when using implicit auth from cms (#223)
1 parent 0dc0311 commit 55b6a15

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/netlify-identity.js

+11
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,17 @@ function runRoutes() {
183183
if (!!document && params["access_token"]) {
184184
document.cookie = `nf_jwt=${params["access_token"]}`;
185185
}
186+
if (params["state"]) {
187+
try {
188+
// skip initialization for implicit auth
189+
const state = decodeURIComponent(params["state"]);
190+
const { auth_type } = JSON.parse(state);
191+
if (auth_type === "implicit") {
192+
return;
193+
}
194+
// eslint-disable-next-line no-empty
195+
} catch (e) {}
196+
}
186197
document.location.hash = "";
187198
store.openModal("login");
188199
store.completeExternalLogin(params);

0 commit comments

Comments
 (0)