Skip to content
Snippets Groups Projects
Commit 0eded0bb authored by SingLi's avatar SingLi
Browse files

Merge pull request #1473 from jparyani/fix-non-logged-in-sandstorm

[Sandstorm] Show more clear login error for Sandstorm users
parents be844100 2aed2c18
No related branches found
No related tags found
No related merge requests found
#!/bin/bash #!/bin/bash
set -euo pipefail set -euo pipefail
export METEOR_SETTINGS='{"public": {"sandstorm": true}}'
exec node /start.js -p 8000 exec node /start.js -p 8000
...@@ -91,6 +91,7 @@ const myCommand :Spk.Manifest.Command = ( ...@@ -91,6 +91,7 @@ const myCommand :Spk.Manifest.Command = (
argv = ["/sandstorm-http-bridge", "8000", "--", "/opt/app/.sandstorm/launcher.sh"], argv = ["/sandstorm-http-bridge", "8000", "--", "/opt/app/.sandstorm/launcher.sh"],
environ = [ environ = [
# Note that this defines the *entire* environment seen by your app. # Note that this defines the *entire* environment seen by your app.
(key = "PATH", value = "/usr/local/bin:/usr/bin:/bin") (key = "PATH", value = "/usr/local/bin:/usr/bin:/bin"),
(key = "SANDSTORM", value = "1")
] ]
); );
...@@ -29,6 +29,9 @@ Template.loginForm.helpers ...@@ -29,6 +29,9 @@ Template.loginForm.helpers
showBackToLoginLink: -> showBackToLoginLink: ->
return 'hidden' unless Template.instance().state.get() in ['register', 'forgot-password', 'email-verification', 'wait-activation'] return 'hidden' unless Template.instance().state.get() in ['register', 'forgot-password', 'email-verification', 'wait-activation']
showSandstorm: ->
return Template.instance().state.get() is 'sandstorm'
btnLoginSave: -> btnLoginSave: ->
switch Template.instance().state.get() switch Template.instance().state.get()
when 'register' when 'register'
...@@ -114,7 +117,10 @@ Template.loginForm.events ...@@ -114,7 +117,10 @@ Template.loginForm.events
Template.loginForm.onCreated -> Template.loginForm.onCreated ->
instance = @ instance = @
@state = new ReactiveVar('login') if Meteor.settings.public.sandstorm
@state = new ReactiveVar('sandstorm')
else
@state = new ReactiveVar('login')
@validate = -> @validate = ->
formData = $("#login-card").serializeArray() formData = $("#login-card").serializeArray()
formObj = {} formObj = {}
......
<template name="loginForm"> <template name="loginForm">
{{#if showSandstorm}}
<div class="alert alert-danger">
You must login to Sandstorm (on the top right) in order to access this chat.
</div>
{{else}}
<form id="login-card" method='/'> <form id="login-card" method='/'>
{{#if waitActivation}} {{#if waitActivation}}
<header> <header>
...@@ -47,4 +52,5 @@ ...@@ -47,4 +52,5 @@
<div class='login-terms'> <div class='login-terms'>
{{{loginTerms}}} {{{loginTerms}}}
</div> </div>
{{/if}}
</template> </template>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment