Completed
Push — master ( d2eec6...69cb9a )
by Temitope
02:30
created
src/Auth/Oauth.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
                 return $response->withJson($validateResponse, 400);
43 43
             }
44 44
 
45
-            if (! $this->verifyUserRegistration($userParams['username'], $userParams['email'])) {
45
+            if (!$this->verifyUserRegistration($userParams['username'], $userParams['email'])) {
46 46
                 $boolResponse = $user->createUser([
47 47
                     'firstname'  => $userParams['firstname'],
48 48
                     'lastname'   => $userParams['lastname'],
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         $tokenId = base64_encode(mcrypt_create_iv(32));
142 142
         $issuedAt = time();
143 143
         $notBefore = $issuedAt;
144
-        $expire =  (float) strtotime('+30 days'); // Adding 30 days expiry date
144
+        $expire = (float) strtotime('+30 days'); // Adding 30 days expiry date
145 145
         $serverName = 'http://localhost:8000/emojis'; // the server name
146 146
 
147 147
         /*
@@ -149,12 +149,12 @@  discard block
 block discarded – undo
149 149
          * Create the token params as an array
150 150
          */
151 151
         $data = [
152
-            'iat'  => $issuedAt,         // Issued at: time when the token was generated
153
-            'jti'  => $tokenId,          // Json Token Id: an unique identifier for the token
154
-            'iss'  => $serverName,       // Issuer
155
-            'nbf'  => $notBefore,        // Not before
156
-            'exp'  => $expire,           // Expire
157
-            'dat'  => $userData,          // User Information retrieved from the database
152
+            'iat'  => $issuedAt, // Issued at: time when the token was generated
153
+            'jti'  => $tokenId, // Json Token Id: an unique identifier for the token
154
+            'iss'  => $serverName, // Issuer
155
+            'nbf'  => $notBefore, // Not before
156
+            'exp'  => $expire, // Expire
157
+            'dat'  => $userData, // User Information retrieved from the database
158 158
         ];
159 159
 
160 160
         $loadEnv = DatabaseConnection::loadEnv();
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
         $secretKey = base64_decode(getenv('secret'));
163 163
 
164 164
         $jwt = JWT::encode(
165
-        $data,      //Data to be encoded in the JWT
165
+        $data, //Data to be encoded in the JWT
166 166
         $secretKey, // The signing key
167 167
         'HS512'     // Algorithm used to sign the token
168 168
         );
Please login to merge, or discard this patch.