File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -193,18 +193,14 @@ public function createAppToken($jwt) {
193193
194194 try {
195195 list ($ uid , $ password , $ options ) = $ this ->decodeJwt ($ jwt );
196-
197- if (is_array ( $ options ) && isset ( $ options [ ' backend ' ]) && $ options [ ' backend ' ] === ' saml ' ) {
196+ $ saml = (( $ options [ ' backend ' ] ?? '' ) === ' saml ' );
197+ if ($ saml ) {
198198 $ this ->autoprovisionIfNeeded ($ uid , $ options );
199199 }
200200
201201 if ($ this ->userManager ->userExists ($ uid )) {
202- // if we have a password, we verify it
203- if (!empty ($ password )) {
204- $ result = $ this ->userSession ->login ($ uid , $ password );
205- } else {
206- $ result = true ;
207- }
202+ // if we have a password, we verify it; if not it means we should be using saml.
203+ $ result = ('' === $ password ) ? $ saml : $ this ->userSession ->login ($ uid , $ password );
208204 if ($ result ) {
209205 $ token = $ this ->tokenHandler ->generateAppToken ($ uid );
210206
You can’t perform that action at this time.
0 commit comments