File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,18 +43,34 @@ protected function isValidSession() : bool
4343 return ( $ this ->isSessionRegistered ()
4444 && !$ this ->isSessionExpired () );
4545 }
46-
46+
4747 /**
48- * Get token access.
48+ * Get access token .
4949 *
5050 * @access protected
5151 * @param string $token
5252 * @param string $secret
5353 * @return array
5454 */
55- protected function getTokenAccess (string $ token , ?string $ secret = null ) : array
55+ protected function getAccessToken (string $ token , ?string $ secret = null ) : array
5656 {
5757 $ encryption = new Encryption ($ token , $ secret );
58- return (array )$ encryption ->decrypt ();
58+ return $ encryption ->setPrefix ()->decrypt () ?: [];
59+ }
60+
61+ /**
62+ * Set access token.
63+ *
64+ * @access protected
65+ * @param string $user
66+ * @param string $pswd
67+ * @param string $secret
68+ * @return string
69+ */
70+ protected function setAccessToken (string $ user , string $ pswd , ?string $ secret = null ) : string
71+ {
72+ $ data = ['user ' => $ user , 'pswd ' => $ pswd ];
73+ $ encryption = new Encryption ($ data , $ secret );
74+ return $ encryption ->setPrefix ()->encrypt ();
5975 }
6076}
You can’t perform that action at this time.
0 commit comments