react-native-nitro-auth 0.5.3 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +2 -5
- package/android/src/main/cpp/PlatformAuth+Android.cpp +84 -18
- package/android/src/main/java/com/auth/AuthAdapter.kt +27 -13
- package/cpp/AuthCache.cpp +0 -44
- package/cpp/AuthCache.hpp +0 -7
- package/cpp/HybridAuth.cpp +20 -2
- package/cpp/HybridAuth.hpp +1 -0
- package/ios/AuthAdapter.swift +2 -0
- package/lib/commonjs/Auth.web.js +96 -43
- package/lib/commonjs/Auth.web.js.map +1 -1
- package/lib/commonjs/service.js +2 -2
- package/lib/commonjs/service.js.map +1 -1
- package/lib/commonjs/use-auth.js +48 -40
- package/lib/commonjs/use-auth.js.map +1 -1
- package/lib/module/Auth.web.js +96 -43
- package/lib/module/Auth.web.js.map +1 -1
- package/lib/module/service.js +2 -2
- package/lib/module/service.js.map +1 -1
- package/lib/module/use-auth.js +48 -40
- package/lib/module/use-auth.js.map +1 -1
- package/lib/typescript/commonjs/Auth.web.d.ts +7 -0
- package/lib/typescript/commonjs/Auth.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/use-auth.d.ts.map +1 -1
- package/lib/typescript/module/Auth.web.d.ts +7 -0
- package/lib/typescript/module/Auth.web.d.ts.map +1 -1
- package/lib/typescript/module/use-auth.d.ts.map +1 -1
- package/package.json +1 -1
- package/react-native-nitro-auth.podspec +1 -1
- package/src/Auth.web.ts +124 -50
- package/src/service.ts +2 -2
- package/src/use-auth.ts +98 -66
- package/ios/KeychainStore.swift +0 -43
package/ios/KeychainStore.swift
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import Foundation
|
|
2
|
-
import Security
|
|
3
|
-
|
|
4
|
-
enum KeychainStore {
|
|
5
|
-
private static let service = "react-native-nitro-auth"
|
|
6
|
-
|
|
7
|
-
static func set(_ value: String, for key: String) {
|
|
8
|
-
guard let data = value.data(using: .utf8) else { return }
|
|
9
|
-
let baseQuery: [String: Any] = [
|
|
10
|
-
kSecClass as String: kSecClassGenericPassword,
|
|
11
|
-
kSecAttrService as String: service,
|
|
12
|
-
kSecAttrAccount as String: key
|
|
13
|
-
]
|
|
14
|
-
SecItemDelete(baseQuery as CFDictionary)
|
|
15
|
-
var attributes = baseQuery
|
|
16
|
-
attributes[kSecValueData as String] = data
|
|
17
|
-
attributes[kSecAttrAccessible as String] = kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly
|
|
18
|
-
SecItemAdd(attributes as CFDictionary, nil)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
static func get(_ key: String) -> String? {
|
|
22
|
-
let query: [String: Any] = [
|
|
23
|
-
kSecClass as String: kSecClassGenericPassword,
|
|
24
|
-
kSecAttrService as String: service,
|
|
25
|
-
kSecAttrAccount as String: key,
|
|
26
|
-
kSecReturnData as String: kCFBooleanTrue as Any,
|
|
27
|
-
kSecMatchLimit as String: kSecMatchLimitOne
|
|
28
|
-
]
|
|
29
|
-
var item: CFTypeRef?
|
|
30
|
-
let status = SecItemCopyMatching(query as CFDictionary, &item)
|
|
31
|
-
guard status == errSecSuccess, let data = item as? Data else { return nil }
|
|
32
|
-
return String(data: data, encoding: .utf8)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
static func remove(_ key: String) {
|
|
36
|
-
let query: [String: Any] = [
|
|
37
|
-
kSecClass as String: kSecClassGenericPassword,
|
|
38
|
-
kSecAttrService as String: service,
|
|
39
|
-
kSecAttrAccount as String: key
|
|
40
|
-
]
|
|
41
|
-
SecItemDelete(query as CFDictionary)
|
|
42
|
-
}
|
|
43
|
-
}
|