@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use app\forms\Activation; |
6 | 6 | use yrc\rest\Action as RestAction; |
7 | - |
|
8 | 7 | use yii\web\HttpException; |
9 | 8 | use Yii; |
10 | 9 |
@@ -43,7 +43,7 @@ |
||
43 | 43 | |
44 | 44 | /** |
45 | 45 | * Deauthenticates a user |
46 | - * @return mixed |
|
46 | + * @return boolean |
|
47 | 47 | */ |
48 | 48 | public static function delete($params) |
49 | 49 | { |
@@ -5,7 +5,6 @@ |
||
5 | 5 | use app\forms\Login; |
6 | 6 | use app\models\Token; |
7 | 7 | use yrc\rest\Action as RestAction; |
8 | - |
|
9 | 8 | use yii\web\UnauthorizedHttpException; |
10 | 9 | use Yii; |
11 | 10 |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use app\models\User; |
6 | 6 | use yrc\rest\Action as RestAction; |
7 | - |
|
8 | 7 | use yii\web\HttpException; |
9 | 8 | use Yii; |
10 | 9 |
@@ -5,8 +5,6 @@ |
||
5 | 5 | use yrc\api\actions\AuthenticationAction; |
6 | 6 | use app\models\User\Token; |
7 | 7 | use yrc\rest\Action as RestAction; |
8 | - |
|
9 | -use yii\web\UnauthorizedHttpException; |
|
10 | 8 | use Yii; |
11 | 9 | |
12 | 10 | /** |
@@ -17,7 +17,7 @@ |
||
17 | 17 | /** |
18 | 18 | * [POST] /api/[...]/register |
19 | 19 | * Handles registration of users |
20 | - * @return mixed |
|
20 | + * @return boolean |
|
21 | 21 | */ |
22 | 22 | public static function post($params) |
23 | 23 | { |
@@ -2,9 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace yrc\api\actions; |
4 | 4 | |
5 | -use app\forms\Register; |
|
6 | 5 | use yrc\rest\Action as RestAction; |
7 | - |
|
8 | 6 | use yii\web\HttpException; |
9 | 7 | use Yii; |
10 | 8 |
@@ -2,7 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace yrc\api\forms; |
4 | 4 | |
5 | -use Base32\Base32; |
|
6 | 5 | use Yii; |
7 | 6 | |
8 | 7 | /** |
@@ -71,7 +71,7 @@ |
||
71 | 71 | |
72 | 72 | /** |
73 | 73 | * Validates the users' password and OTP code |
74 | - * @param array $attributes |
|
74 | + * @param array $attribute |
|
75 | 75 | * @param array $params |
76 | 76 | */ |
77 | 77 | public function validatePasswordAndOTP($attribute, $params) |
@@ -97,7 +97,6 @@ |
||
97 | 97 | |
98 | 98 | /** |
99 | 99 | * Retrieves an instance of self |
100 | - * @param string $tokenString The string access token |
|
101 | 100 | * @return Token|null |
102 | 101 | */ |
103 | 102 | public static function find(array $params = []) |
@@ -224,7 +224,7 @@ |
||
224 | 224 | |
225 | 225 | /** |
226 | 226 | * Provisions TOTP for the account |
227 | - * @return boolean|string |
|
227 | + * @return false|string |
|
228 | 228 | */ |
229 | 229 | public function provisionOTP() |
230 | 230 | { |
@@ -3,10 +3,8 @@ |
||
3 | 3 | namespace yrc\api\models; |
4 | 4 | |
5 | 5 | use app\models\User\Token; |
6 | - |
|
7 | 6 | use Base32\Base32; |
8 | 7 | use OTPHP\TOTP; |
9 | - |
|
10 | 8 | use yii\behaviors\TimestampBehavior; |
11 | 9 | use yii\db\ActiveRecord; |
12 | 10 | use yii\filters\RateLimitInterface; |
@@ -237,8 +237,8 @@ discard block |
||
237 | 237 | $totp = new TOTP( |
238 | 238 | $this->email, |
239 | 239 | $encodedSecret, |
240 | - 30, // 30 second window |
|
241 | - 'sha256', // SHA256 for the hashing algorithm |
|
240 | + 30, // 30 second window |
|
241 | + 'sha256', // SHA256 for the hashing algorithm |
|
242 | 242 | 6 // 6 digits |
243 | 243 | ); |
244 | 244 | |
@@ -292,8 +292,8 @@ discard block |
||
292 | 292 | $totp = new TOTP( |
293 | 293 | $this->email, |
294 | 294 | $this->otp_secret, |
295 | - 30, // 30 second window |
|
296 | - 'sha256', // SHA256 for the hashing algorithm |
|
295 | + 30, // 30 second window |
|
296 | + 'sha256', // SHA256 for the hashing algorithm |
|
297 | 297 | 6 // 6 digits |
298 | 298 | ); |
299 | 299 |