mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-30 15:19:56 +00:00
Fixed JWT padding
This commit is contained in:
parent
488c03c200
commit
32a78e679a
@ -206,11 +206,14 @@ class ProcessLoginTask extends AsyncTask{
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static function b64UrlDecode(string $str) : string{
|
private static function b64UrlDecode(string $str) : string{
|
||||||
|
if(($len = strlen($str) % 4) !== 0){
|
||||||
|
$str .= str_repeat('=', 4 - $len);
|
||||||
|
}
|
||||||
return base64_decode(strtr($str, '-_', '+/'), true);
|
return base64_decode(strtr($str, '-_', '+/'), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function b64UrlEncode(string $str) : string{
|
private static function b64UrlEncode(string $str) : string{
|
||||||
return strtr(base64_encode($str), '+/', '-_');
|
return rtrim(strtr(base64_encode($str), '+/', '-_'), '=');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onCompletion(Server $server) : void{
|
public function onCompletion(Server $server) : void{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user