aboutsummaryrefslogtreecommitdiff
path: root/QSThingsPlugin/Actions/SetThingsAuthenticationKeyAction.m
diff options
context:
space:
mode:
Diffstat (limited to 'QSThingsPlugin/Actions/SetThingsAuthenticationKeyAction.m')
-rw-r--r--QSThingsPlugin/Actions/SetThingsAuthenticationKeyAction.m21
1 files changed, 21 insertions, 0 deletions
diff --git a/QSThingsPlugin/Actions/SetThingsAuthenticationKeyAction.m b/QSThingsPlugin/Actions/SetThingsAuthenticationKeyAction.m
new file mode 100644
index 0000000..b9e7031
--- /dev/null
+++ b/QSThingsPlugin/Actions/SetThingsAuthenticationKeyAction.m
@@ -0,0 +1,21 @@
+#import "SetThingsAuthenticationKeyAction.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@implementation SetThingsAuthenticationKeyAction
+
+- (QSObject *)setAuthenticationKey:(QSObject *)directObject
+{
+
+ NSString *contents = [directObject displayName];
+ if (contents) {
+ [KeychainHelper setAuthenticationKey:contents];
+ } else {
+ [KeychainHelper deleteAuthenticationKey];
+ }
+ return directObject;
+}
+
+@end
+
+NS_ASSUME_NONNULL_END