diff options
Diffstat (limited to 'routes/subscribe.php')
| -rw-r--r-- | routes/subscribe.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/routes/subscribe.php b/routes/subscribe.php index e081309..9795aa1 100644 --- a/routes/subscribe.php +++ b/routes/subscribe.php @@ -12,6 +12,15 @@ Router::getInstance()->mount('/subscribe', function (array $args) { $instance->auth->outboundPushEnabled = true; $instance->save(); http_response_code(204); // "No Content" + + // similar to in Instance->requestOutboundAuthToken, i'm gonna start auth in the other direction at this point + // my intention is that with these two pieces of code, any two digitigrade instances will complete full 2-way + // auth and subscribe "handshakes" when either one tries to auth with the other + // with a small network i don't think this will be a problem but as it grows this could cause a lot of extra + // overhead potentially? + // also worth noting this is run immediately rather than scheduled as a job. might be best to change that. + if ($instance->auth->outboundToken == null) + $instance->beginOutboundAuth(); }); Router::getInstance()->mount('/unsubscribe', function (array $args) { |
