Skip to content

Commit c712a66

Browse files
authored
Merge pull request #250 from 0xPolygonID/fix/delete-auth-response-from-callback
return only verification status
2 parents 657e351 + e970e13 commit c712a66

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

docs/verifier/verification-library/verifier-set-up.md

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ func Callback(w http.ResponseWriter, r *http.Request) {
348348
http.Error(w, err.Error(), http.StatusInternalServerError)
349349
return
350350
}
351-
authResponse, err := verifier.FullVerify(
351+
_, err = verifier.FullVerify(
352352
r.Context(),
353353
string(tokenBytes),
354354
authRequest.(protocol.AuthorizationRequestMessage),
@@ -359,17 +359,7 @@ func Callback(w http.ResponseWriter, r *http.Request) {
359359
return
360360
}
361361

362-
//marshal auth resp
363-
messageBytes, err := json.Marshal(authResponse)
364-
if err != nil {
365-
log.Println(err.Error())
366-
http.Error(w, err.Error(), http.StatusInternalServerError)
367-
return
368-
}
369-
370362
w.WriteHeader(http.StatusOK)
371-
w.Header().Set("Content-Type", "application/json")
372-
w.Write(messageBytes)
373363
log.Println("verification passed")
374364
}
375365
```
@@ -415,11 +405,11 @@ async function callback(req, res) {
415405
const opts = {
416406
AcceptedStateTransitionDelay: 5 * 60 * 1000, // 5 minute
417407
};
418-
authResponse = await verifier.fullVerify(tokenStr, authRequest, opts);
408+
await verifier.fullVerify(tokenStr, authRequest, opts);
419409
} catch (error) {
420410
return res.status(500).send(error);
421411
}
422-
return res.status(200).set("Content-Type", "application/json").send(authResponse);
412+
return res.status(200);
423413
}
424414
```
425415

0 commit comments

Comments
 (0)