diff --git a/src/components/Channel.vue b/src/components/Channel.vue
index fc30cd1e..116afb7b 100644
--- a/src/components/Channel.vue
+++ b/src/components/Channel.vue
@@ -6,6 +6,16 @@
@@ -30,6 +40,11 @@ export default {
channel: null,
};
},
+ computed: {
+ authenticated(_this) {
+ return _this.getAuthToken() !== undefined;
+ },
+ },
mounted() {
this.getChannelData();
},
@@ -65,6 +80,22 @@ export default {
});
}
},
+ subscribeHandler() {
+ this.fetchJson(this.apiUrl() + "/subscribe", null, {
+ method: "POST",
+ body: JSON.stringify({
+ // channelId: this.channel.id,
+ }),
+ headers: {
+ "Auth-Token": this.getAuthToken(),
+ "Content-Type": "application/json",
+ },
+ }).then(resp => {
+ if (resp.status === "ok") {
+ alert("Subscribed!");
+ }
+ });
+ },
},
components: {
ErrorHandler,
diff --git a/src/components/LoginPage.vue b/src/components/LoginPage.vue
new file mode 100644
index 00000000..3be179e8
--- /dev/null
+++ b/src/components/LoginPage.vue
@@ -0,0 +1,66 @@
+
+
+
+
+
diff --git a/src/components/Navigation.vue b/src/components/Navigation.vue
index b154e006..26bb6884 100644
--- a/src/components/Navigation.vue
+++ b/src/components/Navigation.vue
@@ -25,6 +25,12 @@
Preferences
+
+ Login
+
+
+ Register
+
@@ -60,6 +66,11 @@ export default {
suggestionsVisible: false,
};
},
+ computed: {
+ shouldShowLogin(_this) {
+ return _this.getAuthToken() == null;
+ },
+ },
methods: {
onKeyUp(e) {
if (e.key === "Enter") {
diff --git a/src/components/RegisterPage.vue b/src/components/RegisterPage.vue
new file mode 100644
index 00000000..afb4bc60
--- /dev/null
+++ b/src/components/RegisterPage.vue
@@ -0,0 +1,66 @@
+