We’re creating a new custom Auth API with a sign-on dialog created in Vue. We’re serving it up via the FallbackRoute
and we’ve enabled SharpPagesFeature
and we’re passing in a few arguments for testing.
public object Any(FallbackForClientRoutes request) =>
new PageResult(Request.GetPage("/"))
{
Args =
{
["AppName"] = "MyStory",
["SupportUrl"] = "https://example.com/support",
["LogoutUrl"] = "https://example.com/logout",
["MyStoryUrl"] = _appSettings.GetString("MyStoryUrl")
},
};
We’d like to pass these arguments into the Vue instance by creating a script block with the arguments formatted as json so that on initialization the Vue app can read the json object as detailed in https://codeburst.io/passing-configuration-to-vue-js-1b96fa8f959
Is there a way to format Args as json, or can I create a context object and have that formatted as json and have it properly encoded within the html?