Closed VasilyStrelyaev closed 2 years ago
Backward compatibility note:
To sum up: you can use legacy tokens with any toolset. New tokens require up-to-date tools.
Since we won't display legacy tokens anywhere when we release a version with new tokens, users will be forced to upgrade TestCafe + Reporter if they lose their legacy token (whenever they keep it).
fixes https://github.com/DevExpress/testcafe-dashboard/issues/1094
validateSettings
, the authentication token is now decoded similar to the Dashboard side. An error is thrown if the token is neither a valid legacy nor a valid new token. Here I should note that if you present a new token to an old validation function (i.e., specify a new token to an oldtestcafe-reporter-dashboard
version), validation will fail. That's intended, because an old reporter won't be able to request a new Dashboard's API handler to verify thetokenId
.reporter.init
method to request the Dashboard'sverifyReporter
API handler to verify the token. If the response is negative (that is, thetokenId
is not valid), theinit
method throws an exception.InitializationError
to pass through our own error catching inassignReporterMethods
and inform TestCafe that the reporter is not able to initialize (TestCafe should stop the test run).