Skip to main content

Nurse Login

MedTrack supports two types of login for nurses:

  1. Password and Email
  • 1a. Sign in with email and password (no OTP)

  • 1b. Sign in with email and password (with OTP)

  1. Magic Link
info

Before you continue, make sure you have a valid nurse account. See Create a Nurse Account for more information.

Password and Email Login

Password and Email login is the most common login method. It requires the nurse to enter their email and password. If the nurse has OTP enabled, they will also need to enter their OTP code.

Let's look at the two types of login.

Login With Password and Email (No OTP)

This is the normal sign-in process. The nurse enters their email and password, your app sends a request to the server, and the server returns a token. The token can be used to authenticate the nurse for subsequent requests.

Details
query NurseSignIn($email: String!, $password: String!) {
nurseSignIn(email: $email, password: $password) {
token
id
email
firstName
lastName
otpEnabled
otpStatus
}
}

Variables:

{
"email": "nurse_email",
"password": "nurse_password"
}

Response

{
"data": {
"nurseSignIn": {
"token": "login_token",
"id": "nurse_id",
"email": "nurse_email",
"firstName": "nurse_first_name",
"lastName": "nurse_last_name",
"otpEnabled": false,
"otpStatus": null
}
}

Password and Email Login (With OTP)

With OTP, nurses can securely sign in using their email and password. This is the same as the normal sign-in process, but instead of the server returning a normal sign-in token, it returns an OTP token. The nurse will then need to enter an OTP code from the authentication app or SMS and the otp token to complete the sign-in process.

info

The nurse must have OTP enabled to use this method. See Enable OTP for Nurse for more information.

Details
query NurseSignIn($email: String!, $password: String!) {
nurseSignIn(email: $email, password: $password) {
token
id
}
}

Variables:

{
"email": "nurse_email",
"password": "nurse_password"
}

Response

{
"data": {
"nurseSignIn": {
"token": "otp_SomeOtpToken",
"id": "nurse_id"
}
}
}

The response will include a token with the prefix otp_. This token is used for OTP verification.

At this point the front end should prompt the nurse for the OTP code from their Authenticator app or SMS.

Once the OTP code is entered, the nurse will need to send it along with the OTP token to complete the sign-in process.

graphql

query NurseVerifySignInWithOtpCode($otpCode: String!, $signInOtpToken: String!) {
nurseVerifySignInWithOtpCode(otpCode: $otpCode, signInOtpToken: $signInOtpToken) {
token
id
}
}

Variables:

{
"otpCode": "nurse_otp_code_from_app",
"signInOtpToken": "otp_SomeOtpToken"
}

Response

{
"data": {
"nurseVerifySignInWithOtpCode": {
"token": "login_token",
"id": "nurse_id"
}
}
}

The response will include a token that can be used for subsequent requests.