Skip to content

Correct error with Optimizely's Notification Script #99

@GeekInTheNorth

Description

@GeekInTheNorth

The following was reported on Stott Security:

Hi,

We are using the Stott Security plugin in several projects. In our latest project, we started encountering multiple 500 errors from the navigation.bundle.js script on a site that uses Opti ID.

After some investigation, it appears that the Index.cshtml file for the SettingsLandingPage (src/Stott.Security.Optimizely/Views/StottSecurity/SettingsLandingPage/Index.cshtml) is missing a line. Specifically, there should be an @Html.AntiForgeryToken() line before the @Html.CreatePlatformNavigationMenu() line.

If you check this blog post: https://world.optimizely.com/blogs/matthew-slim/dates/2023/6/new-menu-system-released and read the comments, you’ll find a solution for this issue.

Example: 
<body>
@Html.AntiForgeryToken()
@Html.CreatePlatformNavigationMenu()
 <div @Html.ApplyPlatformNavigation()>
....rest of code

There’s also another blog post describing the same problem: https://world.optimizely.com/blogs/allthingsopti/dates/2025/10/a-day-in-the-life-of-an-optimizely-omvp---creating-a-blazor-add-on/

Best regards,
Anders

Metadata

Metadata

Assignees

No one assigned

    Labels

    CompleteChanges merged to develop and pending release.bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions