Skip to content

Commit

Permalink
Update meteor and replace account template package
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanathan committed Feb 15, 2017
1 parent ffca276 commit a962685
Show file tree
Hide file tree
Showing 12 changed files with 177 additions and 108 deletions.
8 changes: 8 additions & 0 deletions .meteor/.finished-upgraders
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,11 @@
notices-for-0.9.0
notices-for-0.9.1
0.9.4-platform-file
notices-for-facebook-graph-api-2
1.2.0-standard-minifiers-package
1.2.0-meteor-platform-split
1.2.0-cordova-changes
1.2.0-breaking-changes
1.3.0-split-minifiers-package
1.4.0-remove-old-dev-bundle-link
1.4.1-add-shell-server-package
1 change: 0 additions & 1 deletion .meteor/cordova-plugins
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

14 changes: 10 additions & 4 deletions .meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ standard-app-packages
coffeescript
mquandalle:stylus
http
email
email@1.1.18
tangelo
mquandalle:jade
twbs:bootstrap
Expand All @@ -19,9 +19,15 @@ mrt:dbproxy
mizzao:autocomplete
chuangbo:marked
iron:router
joshowens:accounts-entry
reactive-var
underscore
[email protected]
[email protected]
bevanhunt:leaflet
miktam:api-password
new3rs:html2canvas
[email protected]
shell-server
accounts-base
accounts-ui
accounts-password
useraccounts:bootstrap
useraccounts:iron-routing
2 changes: 1 addition & 1 deletion .meteor/release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
METEOR@1.0.1
METEOR@1.4.2.6
187 changes: 103 additions & 84 deletions .meteor/versions
Original file line number Diff line number Diff line change
@@ -1,92 +1,111 @@
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
anti:[email protected]
[email protected]
aslagle:[email protected]
[email protected]
[email protected]
bevanhunt:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
chuangbo:[email protected]
[email protected]
[email protected]
[email protected]
d3js:[email protected]
dandv:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
fortawesome:[email protected]
aslagle:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
bevanhunt:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
chuangbo:[email protected]_1
[email protected]_1
d3js:[email protected]
dandv:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
fortawesome:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
iron:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
iron:[email protected]
iron:[email protected]
iron:[email protected].3
iron:[email protected].3
iron:[email protected].12
iron:[email protected].12
iron:[email protected]
iron:[email protected]
iron:[email protected]
iron:[email protected]
joshowens:[email protected]
joshowens:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
miktam:[email protected]
[email protected]
[email protected]
mizzao:[email protected]
[email protected]
[email protected]
mquandalle:[email protected]
iron:[email protected]
iron:[email protected]
iron:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
miktam:[email protected]
[email protected]
[email protected]
[email protected]
mizzao:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
mquandalle:[email protected]
mquandalle:[email protected]
mquandalle:[email protected]
mrt:[email protected]
mrt:[email protected]
mrt:[email protected]
new3rs:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
sacha:[email protected]
schnie:[email protected]
[email protected]
[email protected]
[email protected]
softwarerero:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]_1
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
sacha:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
softwarerero:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
twbs:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
useraccounts:[email protected]
useraccounts:[email protected]
useraccounts:[email protected]
[email protected]
[email protected]
6 changes: 3 additions & 3 deletions client/0views/dash.jade
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ template(name="dash")
span=label
.left-panel.diagnosis(class="{{#unless sideBarOpen}} closed {{/unless}}")
+reactiveTable collection=diseases settings=tableSettings
if signedIn
if currentUser
.btn-group.btn-group-justified.btn-group-sm
if prevDiagnosisId
unless prevDiagnosisError
Expand All @@ -30,7 +30,7 @@ template(name="dash")
else
a.btn.btn-default.rediagnose Rediagnose
.secondary-actions
if signedIn
if currentUser
a.open-feedback(data-toggle="modal" data-target="#feedback-modal")
i.fa.fa-comment(
data-toggle="tooltip"
Expand Down Expand Up @@ -173,5 +173,5 @@ template(name="dash")
a.clear-annotations Clear Annotations

//- Feedback Modal
if signedIn
if currentUser
+feedback
14 changes: 9 additions & 5 deletions client/config/accounts_config.coffee
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Meteor.startup ->
AccountsEntry.config
homeRoute: '/'
dashboardRoute: '/'
passwordSignupFields: 'EMAIL_ONLY'
AccountsTemplates.configureRoute 'signIn',
layoutTemplate: 'layout',
redirect: ->
if window.location.pathname == '/sign-in'
Router.go '/'

AccountsTemplates.configure
#hideSignUpLink: true
showForgotPasswordLink: true
2 changes: 0 additions & 2 deletions client/controllers/search_eidr.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ Router.route("searchEidr",
where: "client"
path: "/searchEidr"
template: "search"
onBeforeAction: () ->
AccountsEntry.signInRequired(@)
waitOn: () ->
if Meteor.userId()
[
Expand Down
2 changes: 0 additions & 2 deletions client/controllers/search_girder.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,6 @@ Router.route("searchGirder",
where: "client"
path: "/searchGirder"
template: "search"
onBeforeAction: () ->
AccountsEntry.signInRequired(@)
waitOn: () ->
if Meteor.userId()
[
Expand Down
1 change: 1 addition & 0 deletions client/stylesheets/misc.import.styl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
margin auto

.symptom-table .info
clear both
width 50%
min-width 400px
max-width 600px
Expand Down
11 changes: 8 additions & 3 deletions routes/client.coffee
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
Results = @grits.Results

redirectIfNotSignedIn = (router) ->
if Meteor.userId()
router.next()
else
router.redirect '/sign-in'

Router.configure
layoutTemplate: "layout"


Router.map () ->

@route("splash",
Expand All @@ -20,7 +25,7 @@ Router.map () ->
path: '/profile/:_id?'
where: 'client'
onBeforeAction: () ->
AccountsEntry.signInRequired(@)
redirectIfNotSignedIn(@)
waitOn: () ->
if Meteor.userId()
[
Expand Down Expand Up @@ -115,7 +120,7 @@ Router.map () ->
where: 'client'
template: 'authenticateSubmission'
onBeforeAction: () ->
AccountsEntry.signInRequired(@)
redirectIfNotSignedIn(@)
onAfterAction: () ->
submissionId = @params._id
Meteor.call('submitFromQuarantine', submissionId, (error, resultId) ->
Expand Down
37 changes: 34 additions & 3 deletions server/accounts_config.coffee
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
Meteor.startup ->
Accounts.emailTemplates.siteName = "GRITS"
Accounts.emailTemplates.from = "GRITS <no-reply@grits>"
Meteor.methods(
###
# Create or update a meteor account for a BSVE user with the given auth info.
# @param authInfo.authTicket - The BSVE authTicket used to verify the account
# with the BSVE.
# @param authInfo.user - The BSVE user's username. The meteor username
# is the BSVE username with bsve- prepended.
###
setPasswordViaBSVEAuthTicket: (authInfo)->
# The api path chosen here is aribitrary, the call is only to verify that
# the auth ticket works.
response = HTTP.get("https://api.bsvecosystem.net/data/v2/sources/PON", {
headers:
"harbinger-auth-ticket": authInfo.authTicket
})
if Meteor.settings.private?.disableBSVEAuthentication
throw new Meteor.Error("BSVEAuthFailure", "BSVE Authentication is disabled.")
if response.data.status != 1
throw new Meteor.Error("BSVEAuthFailure", response.data.message)
meteorUser = Meteor.users.findOne(username: "bsve-" + authInfo.user)
if not meteorUser
console.log "Creating user"
{firstName, lastName} = authInfo.userData
userId = Accounts.createUser(
username: "bsve-" + authInfo.user
profile:
name: firstName + " " + lastName
)
else
userId = meteorUser._id
password = Random.secret()
Accounts.setPassword(userId, password, logout:false)
return password
)

0 comments on commit a962685

Please sign in to comment.