@must_be_logged_in
def unconfirmed_email_remove(auth=None):
 user = auth.user
 json_body = request.get_json()
 try:
  given_token = json_body['token']
 except KeyError:
  raise HTTPError(http.BAD_REQUEST, data={'message_short': 'Missing token', 'message_long': 'Must provide a token'})
 user.clean_email_verifications(given_token=given_token)
 user.save()
 return ({'status': 'success', 'removed_email': json_body['address']}, 200)

@ must_be_logged_in def unconfirmed_email_remove ( auth = None ) : user = auth . user json_body = request . get_json ( ) try : given_token = json_body [ 'token' ] except KeyError : raise HTTPError ( http . BAD_REQUEST , data = { 'message_short' : 'Missing token' , 'message_long' : 'Must provide a token' } ) user . clean_email_verifications ( given_token = given_token ) user . save ( ) return ( { 'status' : 'success' , 'removed_email' : json_body [ 'address' ] } , 200 )
called at login if user cancels their merge or email add .