Service to handle disconnection logic, providing options to redirect or display an alert message.
Disconnect
This service manages user disconnection by either redirecting the user to a specified URL (for web platforms) or showing a custom alert message.
disconnect
The options for handling disconnection.
Function to display an alert message if a redirect is not needed.
The URL to redirect to upon disconnection, if applicable.
Flag indicating if the application is running on the web.
Optional function to update validation state, primarily for native applications.
A promise that resolves when the disconnection process completes.
const disconnectOptions = { showAlert: (alert) => console.log(alert.message), redirectURL: 'https://example.com/home', onWeb: true, updateValidated: (isValid) => console.log(`Validation updated: ${isValid}`)};disconnectService.disconnect(disconnectOptions); Copy
const disconnectOptions = { showAlert: (alert) => console.log(alert.message), redirectURL: 'https://example.com/home', onWeb: true, updateValidated: (isValid) => console.log(`Validation updated: ${isValid}`)};disconnectService.disconnect(disconnectOptions);
Handles the disconnection logic by either redirecting to a specified URL or showing an alert.
A promise that resolves when the disconnection handling is complete.
Service to handle disconnection logic, providing options to redirect or display an alert message.
Name
Disconnect
Description
This service manages user disconnection by either redirecting the user to a specified URL (for web platforms) or showing a custom alert message.
Method
disconnect
Async
Param: options
The options for handling disconnection.
Param: options.showAlert
Function to display an alert message if a redirect is not needed.
Param: options.redirectURL
The URL to redirect to upon disconnection, if applicable.
Param: options.onWeb
Flag indicating if the application is running on the web.
Param: options.updateValidated
Optional function to update validation state, primarily for native applications.
Returns
A promise that resolves when the disconnection process completes.
Example