@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
48 | - * @return sodium_crypto_sign_publickey |
|
48 | + * @return string |
|
49 | 49 | */ |
50 | 50 | public function getSignPublicKey() |
51 | 51 | { |
@@ -55,8 +55,7 @@ discard block |
||
55 | 55 | /** |
56 | 56 | * Generates a new auth and refresh token pair |
57 | 57 | * @param int $userId |
58 | - * @param bool $pubkey |
|
59 | - * @return array |
|
58 | + * @return Token |
|
60 | 59 | */ |
61 | 60 | public static function generate($userId = null) |
62 | 61 | { |
@@ -72,7 +72,7 @@ |
||
72 | 72 | $token->user_id = $userId; |
73 | 73 | $token->access_token = \str_replace('=', '', Base32::encode(\random_bytes(32))); |
74 | 74 | $token->refresh_token = \str_replace('=', '', Base32::encode(\random_bytes(32))); |
75 | - $token->ikm = \base64_encode(\random_bytes(32)); |
|
75 | + $token->ikm = \base64_encode(\random_bytes(32)); |
|
76 | 76 | $token->secret_sign_kp = \base64_encode(sodium_crypto_sign_secretkey($signKp)); |
77 | 77 | $token->expires_at = \strtotime(static::TOKEN_EXPIRATION_TIME); |
78 | 78 |