Skip to content

Instantly share code, notes, and snippets.

@khades
Created May 18, 2016 19:59
Show Gist options
  • Save khades/53e8cc6a44d28ee13f6d5a98b405347e to your computer and use it in GitHub Desktop.
Save khades/53e8cc6a44d28ee13f6d5a98b405347e to your computer and use it in GitHub Desktop.
var m = require("mithril")
var Auth = require("../utils/Auth")
var BodyComponent = require("./BodyComponent")
var AuthBodyComponent = {
controller: function() {
if (Auth.check() == false) {
m.route("/login")
}
},
view: function(ctrl, args, content) {
return m.component(BodyComponent, args, content)
}
}
module.exports = AuthBodyComponent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment