...
The SiteURL screen will remember the last submitted organization organisation URL to make logging in easierit faster and more convenient to log in. This is done by storing the submitted URL into in AsyncStorage
when the form is submitted under the key @LAST_URL
key, and then retrieving the value again when the SiteURL screen is next navigated tovisited.
Customisations
This enhancement is enabled by default. Any modifications to how the feature works can be done in the src/totara/auth/manual/SiteUrl.tsx
and src/totara/auth/manual/SiteUrlHook.ts
files. Below are some examples of how you may want to customise how it works.
...
In the SiteUrl.tsx
file there is an onSubmit
function which is returned by the useSiteUrl
hook, which is how the URL is submitted to proceed to the next page. This can be called when the page mounts with a hard-coded URL to automatically proceed to the Login login screen.
Allowing choice of multiple URLs
Data stored in AsyncStorage
are stored as strings. To store multiple URLs for the user to select from, instead of storing a single string into AsyncStorage
, an array of URLs could be JSON.stringify
-ed and then stored. Then when reading the value, the JSON can be parsed and the resulting array of strings could be presented in a dropdown-like UI.
...