General onetime service (#6340)
commit1b5f0331d3d5b1c9aeb79e1dcd2007e1a3be81b1
authorJerry Padgett <sjpadgett@gmail.com>
Mon, 17 Apr 2023 16:52:48 +0000 (17 12:52 -0400)
committerGitHub <noreply@github.com>
Mon, 17 Apr 2023 16:52:48 +0000 (17 12:52 -0400)
tree123d8e436702c7d567bd545b6809109d9b6b8450
parent2ddbb8622ba7f65cd68f54837dd6ae07af7b2dff
General onetime service (#6340)

* General onetime service
- new onetime service with redirect

* more onetime service

* add onetime table and supporting methods

* fix previouse alter table error
add table to 700-701 upgrade

* database add onetime_auth

* add return redirect url from table if redirect token not included in onetime request
clean up test stuff index

* Telehealth Invitation with onetime integration (#23)

* Telehealth Invitation with onetime integration

Added a config option and integrated the telehealth invitation

* Fix join link creation with email

Email inviation was appending additional parameters which throws off the
one time join link.

* Add patient_portal_onsite_two to session

The patient_portal_onsite_two is part of the verify_session.php script
and needs to be set in the one time.

* Exceptions instead of die, additional session vars

Added additional session variables that were missing.  Also changed the
die logic to use exceptions so we can both log it in the database and
redirect back to the login page for a better UX experience.

Until the core PR with the config gets merged in, defaulted the
telehealth config to be enabled for one time logins.

Changed the method signature to return the auth array so we can log the
pid in the one time usage.  The service redirects the browser and relies
on the caller to exit once they've done any processing logic.

* remove redirect token from table
add flag to include redirect token in url
changes merged from Stephens branch

* Last two session variables that were missing (#24)

Found the last two session variables that were causing the session to
die by the portal/handle_note.php page.

* style fixes
remove unused session vars on redirect

* session regen after redirect
clean up crypto use

* conflict

* Onetime Changes - third party invite, fix settings. (#25)

* Last two session variables that were missing

Found the last two session variables that were causing the session to
die by the portal/handle_note.php page.

* Added generate invite link feature, fixed settings.

Implemented a generate invite link feature since we have to dynamically
generate an invite link now for the one time login links.  Since the
links are generated on the backend server we have to have a two step
process for grabbing the session link.  First the link is generated and
inserted into the DOM and then the browser can copy the link and the
invitation.  Firefox and safari block the copy feature when the copied
content is generated asynchronously.

Fixed the settings stuff that got lost during the merge conflict.

Added a setting option to configure the expiration time on the the one
time links.  Has a minimum of 1 minute and a maximum of 30 minutes.  If
the setting is missing or invalid it defaults to 15 minutes.

Fixed the display of the request media permissions prompt.

Fixed some javascript errors when the conference room shuts down.

Fixed bug with the plain text email invitations missing the join link.

* additional updates
add new portal message alerts for onetimes
fix path slashes

* comment session id

* validate portal address from global to prevent mangled url

---------

Co-authored-by: Stephen Nielson <stephen.nielson@gmail.com>
25 files changed:
interface/modules/custom_modules/oe-module-claimrev-connect/src/GlobalConfig.php
interface/modules/custom_modules/oe-module-comlink-telehealth/public/assets/js/dist/telehealth.js
interface/modules/custom_modules/oe-module-comlink-telehealth/public/assets/js/dist/telehealth.min.js
interface/modules/custom_modules/oe-module-comlink-telehealth/public/assets/js/src/add-patient-dialog.js
interface/modules/custom_modules/oe-module-comlink-telehealth/public/assets/js/src/conference-room.js
interface/modules/custom_modules/oe-module-comlink-telehealth/public/assets/js/src/patient-conference-room.js
interface/modules/custom_modules/oe-module-comlink-telehealth/public/index-portal.php
interface/modules/custom_modules/oe-module-comlink-telehealth/src/Bootstrap.php
interface/modules/custom_modules/oe-module-comlink-telehealth/src/Controller/TeleHealthFrontendSettingsController.php
interface/modules/custom_modules/oe-module-comlink-telehealth/src/Controller/TeleconferenceRoomController.php
interface/modules/custom_modules/oe-module-comlink-telehealth/src/Services/TeleHealthParticipantInvitationMailerService.php
interface/modules/custom_modules/oe-module-comlink-telehealth/src/TelehealthGlobalConfig.php
interface/modules/custom_modules/oe-module-comlink-telehealth/templates/comlink/conference-room/patient-participant-row.html.twig
interface/modules/custom_modules/oe-module-comlink-telehealth/templates/comlink/emails/telehealth-invitation-existing.html.twig
interface/modules/custom_modules/oe-module-comlink-telehealth/templates/comlink/emails/telehealth-invitation-existing.text.twig
interface/modules/custom_modules/oe-module-comlink-telehealth/templates/comlink/emails/telehealth-invitation-new.html.twig
interface/modules/custom_modules/oe-module-comlink-telehealth/templates/comlink/emails/telehealth-invitation-new.text.twig
interface/modules/custom_modules/oe-module-comlink-telehealth/templates/comlink/waiting-room.twig
interface/modules/custom_modules/oe-module-comlink-telehealth/welcome.php
portal/index.php
sql/7_0_0-to-7_0_1_upgrade.sql
sql/database.sql
src/Common/Auth/Exception/OneTimeAuthException.php [new file with mode: 0644]
src/Common/Auth/Exception/OneTimeAuthExpiredException.php [new file with mode: 0644]
src/Common/Auth/OneTimeAuth.php [new file with mode: 0644]