This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// -- wrapper around m.request using #next branch | |
import m from 'mithril' | |
const api = { | |
request: (options) => { | |
options.config = xhr => { | |
xhr.setRequestHeader('Authorization', 'Bearer ' + api.token()) | |
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest') | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var isLoggedIn = false; | |
m.route.prefix('') | |
//-- pages | |
var home = { | |
view: () => m('p', 'Home') | |
} | |
var some = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package middlewares | |
import ( | |
"github.com/labstack/echo" | |
"github.com/labstack/echo/middleware" | |
jwt "github.com/dgrijalva/jwt-go" | |
) | |
type JwtCustomClaims struct { | |
ID uint `json:"id"` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package middlewares | |
import ( | |
"github.com/labstack/echo" | |
"github.com/labstack/echo/middleware" | |
) | |
func SetJwtMiddlewares(g *echo.Group) { | |
g.Use(middleware.JWTWithConfig(middleware.JWTConfig{ | |
SigningMethod: "HS512", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (u *User,) generateUserJwt(origin *UserLogged) (error, string) { | |
cfg := config.GetConfig() | |
// Set custom claims | |
claims := &JwtCustomClaims{ | |
origin.ID, | |
origin.Role, | |
jwt.StandardClaims{ | |
ExpiresAt: time.Now().Add(time.Hour * 72).Unix(), | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2018-07-16 09:40:06.756 [error] <0.409.0>@vmq_diversity_lager:error:36 a intrat aici | |
2018-07-16 09:40:06.758 [error] <0.409.0>@vmq_diversity_lager:error:36 all bad | |
2018-07-16 09:40:06.758 [warning] <0.491.0>@vmq_mqtt_fsm:check_user:555 can't authenticate client {[],<<"ctin">>} due to error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.config = { | |
// See http://brunch.io/#documentation for docs. | |
files: { | |
javascripts: { | |
joinTo: { | |
"js/app.js": 'js/app.js', | |
"js/rating.js": 'js/rating.js' | |
} | |
}, | |
stylesheets: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="js/fine-uploader.min.js"></script> | |
<link href="css/fine-uploader-new.css"> | |
<script type="text/template" id="qq-template"> | |
<div class="qq-uploader-selector qq-uploader" qq-drop-area-text="Drop files here"> | |
<div class="qq-total-progress-bar-container-selector qq-total-progress-bar-container"> | |
<div role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" class="qq-total-progress-bar-selector qq-progress-bar qq-total-progress-bar"></div> | |
</div> | |
<div class="qq-upload-drop-area-selector qq-upload-drop-area" qq-hide-dropzone> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { FuseBox, SVGPlugin, CSSPlugin, BabelPlugin, UglifyJSPlugin} = require("fuse-box"); | |
const isProduction = process.argv.indexOf("--production") > -1; | |
// Plugins | |
const devPlugins = [ | |
SVGPlugin(), | |
CSSPlugin(), | |
BabelPlugin() | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { FuseBox, SVGPlugin, CSSPlugin, BabelPlugin, UglifyJSPlugin} = require("fuse-box"); | |
const isProduction = process.argv.indexOf("--production") > -1; | |
// Plugins | |
const devPlugins = [ | |
SVGPlugin(), | |
CSSPlugin(), | |
BabelPlugin() | |
] |