Skip to content

Latest commit

 

History

History
85 lines (63 loc) · 3.51 KB

DOCS.md

File metadata and controls

85 lines (63 loc) · 3.51 KB

Classes

EmailVerifier

Typedefs

template : function

EmailVerifier

Kind: global class

new EmailVerifier(settings)

Instantiates a new Email Verifier object. Requires specifying a sending email account by either service (ex: gmail) or server host and port.

Param Type Default Description
settings Object settings
settings.credentials Credentials uPort Credentials object
settings.callbackUrl string endpoint to call when user scans email verification QR
settings.user string sender email address
settings.pass string sender email password
[settings.service] string mail service, takes precedence over mail server params
[settings.host] string mail server host name
[settings.port] number mail server port number
[settings.secure] boolean false TLS flag
[settings.confirmSubject] string confirmation email subject
[settings.receiveSubject] string receive attestation email subject
[settings.confirmTemplate] template confirmation email template
[settings.receiveTemplate] template receive attestation email template
[settings.customRequestParams] Object custom params for credentials.createRequest()

emailVerifier.receive(email, [callbackUrl]) ⇒ string

Generates a selective disclosure request and sends an email containing the request QR.

Kind: instance method of EmailVerifier
Returns: string - selective disclosure request token

Param Type Default Description
email string email address to send selective disclosure QR to
[callbackUrl] string "this.callbackUrl" endpoint to call when user scans email verification QR

emailVerifier.verify(accessToken, [settings])

Signs a claim attesting ownership of the email address to the uPort identity that sent the access token. Sends the attestation via push notification and email.

Kind: instance method of EmailVerifier

Param Type Description
accessToken string access token sent by uPort mobile in response to selective disclosure request
[settings] Object options to send email attestation
settings.sendPush boolean flag to send email attestation via push notification
settings._sendEmail boolean flag to send email attestation via email containing QR code

template : function

Kind: global typedef

Param Type Description
QR string QR code to embed in the template