Auth0 Home Blog Docs

SyntaxError: Invalid shorthand property initializer when trying to use the state parameter



I’d like to redirect users to a URL that uses their user handle as part of the URL and am getting and error. Any assistance would be appreciated.

window.addEventListener(‘load’, function() {
var options = {
state = {
“auth0_authorize”: “data.userHandle”,
“return_url”: “
theme: {
primaryColor: ‘#FFFFFF
auth: {
redirect: false
allowSignin: false,
container: ‘hiw-login-container’,
allowedConnections: ‘google-oauth2’, ‘aol’, ‘yahoo’, ‘windowslive’],
socialButtonStyle: ‘big’,
rememberLastLogin: false,
languageDictionary: {
title: “Instamynd”


The error in question is caused by use of invalid syntax, more specifically:

var options = { state = { "auth0_authorize": "data.userHandle" //...

The correct syntax for object initialization of the options variable would be to use:

var options = { state: { "auth0_authorize": "data.userHandle" //...

Notice the use of : instead of = for the initialization of the state property.


Thank you.