mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
add email code verification
by hitting POST /<user_id>/email-code, we create an email two factor code to send to the user. That email contains a link with a token that will sign the user in when opened. Also some other things: "email verification" (aka when you first create an account) doesn't hit the API anymore refactor 2fa code verification and sending to use jsonschema, and share code between sms and email Die marshmallow die!
This commit is contained in:
35
app/user/users_schema.py
Normal file
35
app/user/users_schema.py
Normal file
@@ -0,0 +1,35 @@
|
||||
post_verify_code_schema = {
|
||||
'$schema': 'http://json-schema.org/draft-04/schema#',
|
||||
'description': 'POST schema for verifying a 2fa code',
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'code': {'type': 'string'},
|
||||
'code_type': {'type': 'string'},
|
||||
},
|
||||
'required': ['code', 'code_type']
|
||||
}
|
||||
|
||||
|
||||
post_send_user_email_code_schema = {
|
||||
'$schema': 'http://json-schema.org/draft-04/schema#',
|
||||
'description': 'POST schema for generating a 2fa email',
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
# doesn't need 'to' as we'll just grab user.email_address
|
||||
'next': {'type': ['string', 'null']},
|
||||
},
|
||||
'required': [],
|
||||
'additionalProperties': []
|
||||
}
|
||||
|
||||
|
||||
post_send_user_sms_code_schema = {
|
||||
'$schema': 'http://json-schema.org/draft-04/schema#',
|
||||
'description': 'POST schema for generating a 2fa email',
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'to': {'type': ['string', 'null']},
|
||||
},
|
||||
'required': [],
|
||||
'additionalProperties': []
|
||||
}
|
||||
Reference in New Issue
Block a user