Skip to content

Instantly share code, notes, and snippets.

@antonvolkoff
Created July 27, 2020 08:30
Show Gist options
  • Save antonvolkoff/171d7fa17878d0e7c8b29d77be7e89ee to your computer and use it in GitHub Desktop.
Save antonvolkoff/171d7fa17878d0e7c8b29d77be7e89ee to your computer and use it in GitHub Desktop.

Prerequirments

Routes:

POST /users/456/verification called by frontend to create verification & redirect to verification process GET /users/456/verification returns status of your verification POST /webhooks/verifications/:id called by 3rd party

Table

verifications
---
id
user_id int
status string
url string # URL where user should be redirected
... # any other columns to store results or identify webhook

Flow

  1. User clicks "Verify"
  2. Application makes a call to /users/456/verification
  3. Verification record is created in database with status pending
  4. User is redirectd for verification process
  5. User has finished
  6. I get a callback from 3rd party and update my Verification record
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment