Universal login and hash-based routing in angularjs app

You can use hash based routing but to do so requires you to specify the callback URL as the root of your application (e.g., /) as the hash fragment that specifies the path will be removed by Auth0, i.e., https://your-domain/#/callback will become https://your-domain/.

Please keep in mind that we strongly recommend against hash based routing and you should use path based routing instead if possible.

RFC3986 defines the expected order of a URL as scheme|authority|path|query|fragment. SPA frameworks like Angular that use hash based routing violate this standard and expect scheme|authority|path|fragment|query instead.

Hash based routing can also introduce problems with Auth0.js when you use the implicit flow as the resulting access token returned is contained within the hash fragment.

1 Like