File tree 1 file changed +7
-9
lines changed
1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -105,19 +105,17 @@ public function login($username, $password) {
105
105
)
106
106
);
107
107
108
- // If 'logged' is true (aka successful login), set the username and auth_token
109
- if ($ result ->logged ) {
110
- $ this ->username = $ result ->username ;
108
+ // If the login is successful, set the username and auth_token.
109
+ if (isset ($ result ->logged ) && $ result ->logged ) {
111
110
$ this ->auth_token = $ result ->auth_token ;
112
- }
111
+ $ this -> username = $ result -> username ;
113
112
114
- // Set cache
115
- if (!empty ($ result )) {
116
113
$ this ->cache = new SnapchatCache ();
117
114
$ this ->cache ->set ('updates ' , $ result );
118
115
}
119
-
120
- return $ result ;
116
+ else {
117
+ return FALSE ;
118
+ }
121
119
}
122
120
123
121
/**
@@ -1178,4 +1176,4 @@ public function updateEmail($email) {
1178
1176
return isset ($ result ->param ) && $ result ->param == $ email ;
1179
1177
}
1180
1178
1181
- }
1179
+ }
You can’t perform that action at this time.
0 commit comments