This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This solution was built based on stackoverflow answer https://stackoverflow.com/a/54233102 | |
* placed by user https://stackoverflow.com/users/2485910/snowball | |
*/ | |
import AWS from 'aws-sdk'; | |
import {Template} from 'aws-sdk/clients/ses'; | |
interface Attachment { | |
encoding: 'base64'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def ensure_clinician_is_logged_in | |
respond_to do |format| | |
format.html { redirect_to "/clinicians/sign_in#{build_url_query}" unless current_clinician } | |
format.json do | |
response.headers['REQUIRES_AUTH'] = '1' | |
render js: "/clinicians/sign_in#{build_json_query}" unless current_clinician | |
end | |
end | |
end |