Is your feature request related to a problem? Please describe.
Create endpoint to receive email verification token and verify email.
It already exists:
POST /v1/auth/verify-email
{
"data": {
"token": "your token"
}
}
@liveHarshit It is there i think ?
Sorry, I don't find it in the server documentation.
Check this out: https://github.com/fossasia/open-event-orga-app/issues/1404#issuecomment-449965876
What is the response? @kushthedude Can you please add it in the server documentation?
@liveHarshit Docs need to be updated for this. Just change the name of this issue to a doc update. Meanwhile, the response is
Response
{
"message": "your token"
}
Status
200
@mrsaicharan1 What is the request payload?
@prateekj117 could i be assigned this issue? i would like to work on this issue.
@sidmttl Go ahead.
I didn't find /v1/auth/verify-email in docs https://open-event-api.herokuapp.com/. Also, I did not find link to server docs? If anyone can help me in that regard, that will be great.
I didn't find
/v1/auth/verify-emailin docs https://open-event-api.herokuapp.com/. Also, I did not find link to server docs? If anyone can help me in that regard, that will be great.
@iamareebjamal Is this issue still available? I would like to work on this.
@iamareebjamal Is this issue still available? I would like to work on this.
Go ahead
@iamareebjamal @liveHarshit I would like to work on this issue. Is this still open?
I am taking this up. @liveHarshit.
@liveHarshit I have added the documentation to the file .apib but how do I check these changes on local? I m unable to see a newly added section in the docs.
@liveHarshit The api response is not receiving verification token as response, the function says something else
@auth_routes.route('/verify-email', methods=['POST'])
def verify_email():
try:
token = base64.b64decode(request.json['data']['token'])
except base64.binascii.Error:
return BadRequestError({'source': ''}, 'Invalid Token').respond()
s = get_serializer()
try:
data = s.loads(token)
except Exception:
return BadRequestError({'source': ''}, 'Invalid Token').respond()
try:
user = User.query.filter_by(email=data[0]).one()
except Exception:
return BadRequestError({'source': ''}, 'Invalid Token').respond()
else:
user.is_verified = True
save_to_db(user)
return make_response(jsonify(message="Email Verified"), 200)
Now what shall I add in the doc?
@liveHarshit The api response is not receiving verification token, the function says something else
@auth_routes.route('/verify-email', methods=['POST']) def verify_email(): try: token = base64.b64decode(request.json['data']['token']) except base64.binascii.Error: return BadRequestError({'source': ''}, 'Invalid Token').respond() s = get_serializer() try: data = s.loads(token) except Exception: return BadRequestError({'source': ''}, 'Invalid Token').respond() try: user = User.query.filter_by(email=data[0]).one() except Exception: return BadRequestError({'source': ''}, 'Invalid Token').respond() else: user.is_verified = True save_to_db(user) return make_response(jsonify(message="Email Verified"), 200)Now what shall I add in the doc?
The endpoint is working:
POST /v1/auth/verify-email
{
"data": {
"token": "your token"
}
}
@liveHarshit I am getting this as response

The response is not this https://github.com/fossasia/open-event-server/issues/6038#issuecomment-502528247
Request is the above as suggested by you
{
"data": {
"token": "your token"
}
}
Response
{
"message": "Email Verified"
}
@liveHarshit I am getting this as response
The response is not this #6038 (comment)
Request is the above as suggested by you
{
"data": {
"token": "your token"
}
}Response
{
"message": "Email Verified"
}
Check how it is used in attendee android app. https://github.com/fossasia/open-event-attendee-android/pull/2037
@liveHarshit The reponse I wrote above "Email verified" in message is not valid? How come?
The API shows same responsse in postman, the function written in server says the same. Also the PR you referred above shows the same msg in response as Email Verified in message
I am telling you that the response as mentioned in https://github.com/fossasia/open-event-server/issues/6038#issuecomment-502528247 is wrong
The response is
Response
{
"message": "Email Verified"
}
not this
{
"message": "your token"
}
Please state, where I am wrong. May be you didn't read my comment here https://github.com/fossasia/open-event-server/issues/6038#issuecomment-554718908
Most helpful comment
https://github.com/fossasia/open-event-server/blob/15e323e062d9a5d37164bd25632de00be1331af2/.travis.yml#L36
https://github.com/fossasia/open-event-server/blob/b3a8c3305ec232f3a0a6b30c5961ca5a43e26df5/scripts/push_api_docs.sh#L26