Secret URL - Fixes #1574
parent
13df770d41
commit
527ffac1fd
@ -1,4 +1,4 @@ |
||||
<template name="blankLayout"> |
||||
<template name="logoLayout"> |
||||
<section class="full-page"> |
||||
<div class="wrapper"> |
||||
<header> |
||||
@ -0,0 +1,21 @@ |
||||
Template.secretURL.helpers |
||||
registrationAllowed: -> |
||||
return RocketChat.settings.get('Accounts_RegistrationForm') is 'Secret URL' and Template.instance().hashIsValid?.get() |
||||
|
||||
ready: -> |
||||
return Template.instance().subscriptionsReady?() and Template.instance().hashReady?.get() |
||||
|
||||
|
||||
Template.secretURL.onCreated -> |
||||
@subscribe 'admin-settings' |
||||
@hashIsValid = new ReactiveVar false |
||||
@hashReady = new ReactiveVar false |
||||
|
||||
Meteor.call 'checkRegistrationSecretURL', FlowRouter.getParam('hash'), (err, success) => |
||||
@hashReady.set true |
||||
if success |
||||
Session.set 'loginDefaultState', 'register' |
||||
KonchatNotification.getDesktopPermission() |
||||
@hashIsValid.set true |
||||
else |
||||
@hashIsValid.set false |
||||
@ -0,0 +1,11 @@ |
||||
<template name="secretURL"> |
||||
{{#if ready}} |
||||
{{#if registrationAllowed}} |
||||
{{> main center="home"}} |
||||
{{else}} |
||||
{{> logoLayout render="invalidSecretURL"}} |
||||
{{/if}} |
||||
{{else}} |
||||
{{> loading}} |
||||
{{/if}} |
||||
</template> |
||||
Loading…
Reference in new issue