File tree 1 file changed +13
-3
lines changed
1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -32,13 +32,23 @@ class Snapchat {
32
32
33
33
34
34
/**
35
- * Sets up some initial variables.
35
+ * Sets up some initial variables. If a username and password are passed in,
36
+ * we attempt to log in. If a username and auth token are passed in, we'll
37
+ * bypass the login process and use those values.
36
38
*/
37
- public function __construct ($ username = NULL , $ password = NULL ) {
39
+ public function __construct ($ username = NULL , $ password = NULL , $ auth_token = NULL ) {
38
40
$ this ->auth_token = FALSE ;
39
41
$ this ->username = FALSE ;
40
42
41
- if (!empty ($ username )) $ this ->login ($ username , $ password );
43
+ if (!empty ($ username )) {
44
+ if (!empty ($ password )) {
45
+ $ this ->login ($ username , $ password );
46
+ }
47
+ elseif (!empty ($ auth_token )) {
48
+ $ this ->auth_token = $ auth_token ;
49
+ $ this ->username = $ username ;
50
+ }
51
+ }
42
52
}
43
53
44
54
You can’t perform that action at this time.
0 commit comments