mirror of
https://github.com/fazo96/homework.git
synced 2025-01-09 12:10:08 +01:00
fixed little security problem, added icons to email ver. page
This commit is contained in:
parent
da964a2a10
commit
6ed12e98d8
@ -4,7 +4,6 @@
|
|||||||
# but you can also edit it by hand.
|
# but you can also edit it by hand.
|
||||||
|
|
||||||
standard-app-packages
|
standard-app-packages
|
||||||
insecure
|
|
||||||
coffeescript
|
coffeescript
|
||||||
bootstrap-3
|
bootstrap-3
|
||||||
font-awesome
|
font-awesome
|
||||||
|
@ -67,8 +67,10 @@ Router.map ->
|
|||||||
# You can't set a callback for when the user logs in using a cookie so...
|
# You can't set a callback for when the user logs in using a cookie so...
|
||||||
# Cheap ass work around for routing the user after he logs in with a token
|
# Cheap ass work around for routing the user after he logs in with a token
|
||||||
Deps.autorun ->
|
Deps.autorun ->
|
||||||
t = Router.current(); return unless t and t.lookupTemplate
|
t = Router.current(); return unless getUser() and t and t.lookupTemplate
|
||||||
if getUser() and t.lookupTemplate() is 'login' then Router.go 'home'
|
temp = t.lookupTemplate()
|
||||||
|
if temp is 'login' or temp is 'homepage' or temp is 'try'
|
||||||
|
Router.go 'home'
|
||||||
|
|
||||||
# Client Templates
|
# Client Templates
|
||||||
|
|
||||||
@ -108,6 +110,8 @@ Template.notelist.getDate = ->
|
|||||||
#day = new Date(@date).toLocaleString().split(' ')[0]
|
#day = new Date(@date).toLocaleString().split(' ')[0]
|
||||||
Template.notelist.notes = ->
|
Template.notelist.notes = ->
|
||||||
d = notes.find({},{ sort: date: 1}).fetch()
|
d = notes.find({},{ sort: date: 1}).fetch()
|
||||||
|
Template.notelist.notelist = ->
|
||||||
|
|
||||||
Template.notelist.events
|
Template.notelist.events
|
||||||
'click .close-note': -> notes.remove @_id
|
'click .close-note': -> notes.remove @_id
|
||||||
'keypress #newNote': (e,template) ->
|
'keypress #newNote': (e,template) ->
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
<template name="notelist">
|
<template name="notelist">
|
||||||
<div class="list-group">
|
<div class="list-group">
|
||||||
{{#each notes}}
|
{{#each notelist}}
|
||||||
<a href="{{pathFor 'note'}}" class="note list-group-item">
|
<a href="{{pathFor 'note'}}" class="note list-group-item">
|
||||||
<span class="note-content">
|
<span class="note-content">
|
||||||
{{#if active}}<a role="button" href="{{pathFor 'notes'}}" class="edit-note close">
|
{{#if active}}<a role="button" href="{{pathFor 'notes'}}" class="edit-note close">
|
||||||
@ -145,10 +145,14 @@
|
|||||||
{{> error}}
|
{{> error}}
|
||||||
<input type="text" id="token-field" class="form-control" placeholder="Token">
|
<input type="text" id="token-field" class="form-control" placeholder="Token">
|
||||||
<div align="center" class="buttons">
|
<div align="center" class="buttons">
|
||||||
<button type="button" class="btn btn-warning btn-ver" id="btn-resend">Resend Email</button>
|
<button type="button" class="btn btn-warning btn-ver" id="btn-resend">
|
||||||
<button type="button" class="btn btn-success btn-ver" id="btn-verify">Verify Token</button>
|
<i class="fa fa-refresh"></i> Resend</button>
|
||||||
<button type="button" class="btn btn-danger btn-ver" id="btn-delete">Delete Account</button>
|
<button type="button" class="btn btn-success btn-ver" id="btn-verify">
|
||||||
<br><button type="button" class="btn btn-primary btn-ver" id="btn-logout">Sign Out</button>
|
<i class="fa fa-check"></i> Verify Token</button>
|
||||||
|
<button type="button" class="btn btn-danger btn-ver" id="btn-delete">
|
||||||
|
<i class="fa fa-trash-o"></i> Delete Account</button>
|
||||||
|
<br><button type="button" class="btn btn-primary btn-ver" id="btn-logout">
|
||||||
|
<i class="fa fa-sign-out"></i> Sign Out</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -7,8 +7,8 @@ else
|
|||||||
console.log "Not Sending Emails, please set the MAIL_URL environment variable"
|
console.log "Not Sending Emails, please set the MAIL_URL environment variable"
|
||||||
|
|
||||||
notes = new Meteor.Collection "notes"
|
notes = new Meteor.Collection "notes"
|
||||||
|
|
||||||
getUser = (id) -> Meteor.users.findOne { _id: id }
|
getUser = (id) -> Meteor.users.findOne { _id: id }
|
||||||
|
isUsers = (u,doc) -> u and doc.userId is u
|
||||||
|
|
||||||
# Returns true if the user has verified at least one email address
|
# Returns true if the user has verified at least one email address
|
||||||
userValidated = (user) ->
|
userValidated = (user) ->
|
||||||
@ -23,6 +23,10 @@ Meteor.publish "archive", ->
|
|||||||
if userValidated getUser(@userId)
|
if userValidated getUser(@userId)
|
||||||
notes.find userId: @userId, archived: yes
|
notes.find userId: @userId, archived: yes
|
||||||
|
|
||||||
|
# Database Permissions
|
||||||
|
# Allow all users to insert, update and remove their notes.
|
||||||
|
notes.allow insert: isUsers, update: isUsers, remove: isUsers
|
||||||
|
|
||||||
# Methods that the clients can invoke
|
# Methods that the clients can invoke
|
||||||
Meteor.methods
|
Meteor.methods
|
||||||
resendConfirmEmail: ->
|
resendConfirmEmail: ->
|
||||||
|
Loading…
Reference in New Issue
Block a user