File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 22
33namespace App \Presenters ;
44
5+ use App \Exceptions \BadRequestException ;
56use App \Exceptions \ForbiddenRequestException ;
67use App \Exceptions \InvalidAccessTokenException ;
78use App \Exceptions \NotFoundException ;
9+ use App \Exceptions \RecodexApiException ;
810use App \Exceptions \WrongCredentialsException ;
911use App \Model \Entity \User ;
1012use App \Model \Repository \Users ;
@@ -84,7 +86,11 @@ public function actionDefault()
8486 {
8587 $ req = $ this ->getRequest ();
8688 $ tempToken = $ req ->getPost ("token " );
87- $ instanceId = $ this ->recodexApi ->getTempTokenInstance ($ tempToken );
89+ try {
90+ $ instanceId = $ this ->recodexApi ->getTempTokenInstance ($ tempToken );
91+ } catch (RecodexApiException $ e ) {
92+ throw new BadRequestException ("Invalid token from ReCodEx API " , $ e );
93+ }
8894
8995 // Call ReCodEx API and get full token + user info using the temporary token
9096 $ this ->recodexApi ->setAuthToken ($ tempToken );
You can’t perform that action at this time.
0 commit comments