OpenWGA 7.9 - TMLScript reference

Auth
Method :

waitForUpdates(timeout)

On object Auth
Usage Waits until updates on an authentication content store are effective
Description This is a rather special method for use in the UI of authentication applications, whose content stores store data about users and groups for login. If a TMLScript process updates login data of the currently logged in user - for example a password - it should stop execution until the authentication backend picks up that change (which mostly happens after a short delay). Only after that it can continue safely, knowing that it can use the updated login data.

Therefor after change of authentication data this method should get called, which waits for the authentication backend of the current domain to pick up updates. The recommended order of operations for updating authentication data of the currently logged in user is:

  1. Change the authentication data
  2. Call waitForAuthUpdates()
  3. Optional subsequent operations which are needed so the current session can use the changed login data, for example changing the password on the user session via Auth.changeSessionPassword()

A timeout prevents this methods from waiting endlessly in the case of an error.

For backward compatibility there still is a method "waitForAuthUpdates()" available on TMLContext whose use is discouraged since OpenWGA 5.3.

Parameters timeout (Number) - Time in seconds that the method is allowed to wait. If this time is exceeded the method throws a TMLScriptException to signal that that the waiting was canceled
Allowed in script types
  • WebTML pages and normal WebTML actions
  • Master actions
  • TMLScript tasks in jobs
  • Content type events