Fix for Base64 decoding

This commit is contained in:
Selim Mustafaev 2020-09-21 10:23:34 +03:00
parent 7a090e8827
commit e63f3ed13d
3 changed files with 5 additions and 5 deletions

View File

@ -767,7 +767,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = AutoCat/AutoCat.entitlements; CODE_SIGN_ENTITLEMENTS = AutoCat/AutoCat.entitlements;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 35; CURRENT_PROJECT_VERSION = 37;
DEVELOPMENT_TEAM = 46DTTB8X4S; DEVELOPMENT_TEAM = 46DTTB8X4S;
INFOPLIST_FILE = AutoCat/Info.plist; INFOPLIST_FILE = AutoCat/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0; IPHONEOS_DEPLOYMENT_TARGET = 13.0;
@ -789,7 +789,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = AutoCat/AutoCat.entitlements; CODE_SIGN_ENTITLEMENTS = AutoCat/AutoCat.entitlements;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 35; CURRENT_PROJECT_VERSION = 37;
DEVELOPMENT_TEAM = 46DTTB8X4S; DEVELOPMENT_TEAM = 46DTTB8X4S;
INFOPLIST_FILE = AutoCat/Info.plist; INFOPLIST_FILE = AutoCat/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0; IPHONEOS_DEPLOYMENT_TARGET = 13.0;

View File

@ -3,9 +3,9 @@ import Foundation
enum Constants { enum Constants {
static var baseUrl: String { static var baseUrl: String {
#if DEBUG #if DEBUG
return "http://127.0.0.1:3000/" //return "http://127.0.0.1:3000/"
//return "http://192.168.1.67:3000/" //return "http://192.168.1.67:3000/"
//return "https://vps.aliencat.pro:8443/" return "https://vps.aliencat.pro:8443/"
#else #else
return "https://vps.aliencat.pro:8443/" return "https://vps.aliencat.pro:8443/"
#endif #endif

View File

@ -94,7 +94,7 @@ class JWT<T> where T: JwtPayload {
if parts.count == 3 { if parts.count == 3 {
var payloadStr = String(parts[1]) var payloadStr = String(parts[1])
if (payloadStr.count % 4 != 0) { if (payloadStr.count % 4 != 0) {
payloadStr += String(repeating: "=", count: (payloadStr.count % 4)) payloadStr += String(repeating: "=", count: (4 - payloadStr.count % 4))
} }
if let json = Data(base64Encoded: payloadStr, options: [.ignoreUnknownCharacters]) { if let json = Data(base64Encoded: payloadStr, options: [.ignoreUnknownCharacters]) {
do { do {