File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
src/Packages/Passport/Runtime/Scripts/Public Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -274,6 +274,13 @@ private async void HandleLoginData(string jsonData)
274274 LoginData loginData = JsonUtility . FromJson < LoginData > ( jsonData ) ;
275275 PassportLogger . Info ( $ "{ TAG } Parsed login data: { loginData } ") ;
276276
277+ // Validate required login data
278+ if ( string . IsNullOrEmpty ( loginData . directLoginMethod ) )
279+ {
280+ PassportLogger . Error ( $ "{ TAG } Login method is required but was null or empty") ;
281+ return ;
282+ }
283+
277284 // For now, just log the data - in the future this could trigger OAuth flow
278285 PassportLogger . Info ( $ "{ TAG } Login attempt - Method: { loginData . directLoginMethod } , Email: { loginData . email } , Marketing Consent: { loginData . marketingConsentStatus } ") ;
279286
@@ -298,8 +305,16 @@ private async void HandleLoginData(string jsonData)
298305 return ;
299306 }
300307 var loginOptions = new DirectLoginOptions ( loginMethod ) ;
301- if ( loginData . email != null )
308+
309+ // Validate email is provided for email login method
310+ if ( loginMethod == DirectLoginMethod . Email )
302311 {
312+ if ( string . IsNullOrEmpty ( loginData . email ) )
313+ {
314+ PassportLogger . Error ( $ "{ TAG } Email is required for email login method but was null or empty") ;
315+ return ;
316+ }
317+
303318 loginOptions . email = loginData . email ;
304319 }
305320
You can’t perform that action at this time.
0 commit comments