Small bug in example code in the documentation

Hey guys!

I'm reading the page on getting the system user ticket from the system user token, and I've found a small bug in the example code that Tony posted -

Specifically, in the index.js file, line 98:
if (successful) {...}
The `successful` variable you're extracting here is a string, and, as such always truthy. This if will always go through, even if there is an authentication error. It should be `if (successful === 'true')` instead.

Also, a small suggestion. On line 22:
const publKeyFile = 'SuperOfficeFederatedLogin.pem';

There's no reference anywhere in the article on where this SuperOfficeFederatedLogin.pem is supposed to come from, or what it should contain. I'm sure I'll find something if I search hard enough in the documentation, but it would be really nice if you would link to that as a side-note in the article.

Thank you very much for this example though! It's helping a lot!

RE: Small bug in example code in the documentation

Hi Camelia,

Great feedback! Thanks for that. Sample code is updated with your suggestions, and I've added the download (top of the page) for the sample code, including the PEM file. The PEM file is just the raw contents of the SuperOfficeFederatedLogin.crt file - which is included in the certificates download under CreateApps => Resources=> Downloads.

Hope this helps!

Af: Tony Yates 25. nov 2020

RE: Small bug in example code in the documentation

Awesome! This does help a lot!

Just as a side-note, you have fixed the if in the example code available for download, but not on the listed code on the lower side of the page. 

I think the download is a lot more useful, to be honest, so in your shoes, I'd probably delete the listed code. :) 

Thank you for the quick help!

Af: Camelia Smeria 25. nov 2020