在我的服务器上,我在使用firebase admin sdk时看到了这些错误 .verifyIdToken()
Firebase ID令牌已过期.从您的客户端应用中获取新的令牌,然后重试
Firebase ID令牌具有"kid"声明,该声明与已知的公钥不对应.很可能ID令牌已过期,因此请从您的客户端应用获取新令牌,然后重试.有关如何检索ID令牌的详细信息,请参阅https://firebase.google.com/docs/auth/admin/verify-id-tokens.
在客户端,我在浏览器<>服务器之间的每个请求之前执行此操作:
firebase.auth().currentUser.getIdToken()
Run Code Online (Sandbox Code Playgroud)
通过阅读文档,我的理解是此函数将获得有效的,未过期的令牌,因为后台的SDK将根据需要自行刷新.或者,我可以传入true此功能以强制刷新.
为什么这个getIdToken()函数似乎是将过期的令牌发送到我的后端?
似乎要解决这个问题我的选择是:
true强制刷新每次我打电话getIdToken时间().这是不必要的昂贵,因为它会在来自浏览器<>我的服务器的请求之前从浏览器<> firebase添加整个往返网络请求的开销getIdToken()我现在的方式 - 在客户端手动解码令牌,检查到期,如果它已过期然后getIdToken(true)再次调用强制刷新并将新刷新的令牌发送到我的服务器2号是推荐/预期的处理方式吗?看来这里有些不对劲......
在rails 3中确实rails s调用了bundler,这样你就不需要在你的应用程序Gemfile环境中运行bundle exec rails s或者bundle exec需要它了rails s吗?
更新
据了解,bundle exec应该在rake任务之前使用,因为rake版本不同.有关详细信息,请参阅 http://railsapps.github.com/installing-rails-3-1.html.这个问题是关于rails脚本的,比如:
rails s
rails server
rails c
rails console
Run Code Online (Sandbox Code Playgroud)
^应该bundle exec在这些rails脚本之前使用,还是由rails命令调用bundle?
Google Apps 有一些简单的触发器:https ://developers.google.com/apps-script/guides/triggers/
其中之一是 onEdit。如文档所述,onEdit 会针对 Google Spreadsheets 触发,但不会针对 Google Docs 触发。
是否有一种干净的方法来检测用户何时更改了文档,并在发生这种情况时运行脚本?
production.rb的默认值是:
config.log_level = :info
但是,我真的很想在我的生产环境中看到SQL查询和额外的日志记录.
将日志级别更改为:
config.log_level = :debug
这是一个非常糟糕的做法吗?这为我的应用程序增加了多少开销,让Rails执行额外的日志记录?
我正在尝试使用Font Awesome:
http://fortawesome.github.com/Font-Awesome/
我在几个Rails项目中使用了这些字体图标没有问题,但出于某种原因,当我尝试在Shopify商店中使用它们时,它们不会被渲染.
我正在使用另一个@ font-face而没有任何困难,但由于某种原因,这个@ font-face没有渲染.
在资产/我有:
fontawesome-webfont.eot
fontawesome-webfont.svg
fontawesome-webfont.ttf
fontawesome-webfont.woff
Run Code Online (Sandbox Code Playgroud)
我用@ font-face加载它们就像我使用另一个工作正常的字体一样.在我的stylesheet.css中,它位于assets /
@font-face {
font-family: "FontAwesome";
src: url('fontawesome-webfont.eot');
src: url('fontawesome-webfont.eot?#iefix') format('eot'),
url('fontawesome-webfont.woff') format('woff'),
url('fontawesome-webfont.ttf') format('truetype'),
url('fontawesome-webfont.svg#FontAwesome') format('svg');
font-weight: normal;
font-style: normal;
}
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试使用图标时,它们似乎无法加载.知道为什么这不适用于Shopify吗?我觉得我错过了一些小事,但我无法理解.
我无法弄清楚我在这里做错了什么。
将字符串传递给moment,使用格式并调用 .toDate()。
toDate() 最终返回一个 1 小时的时间
moment("2015-11-19T18:34:00-07:00", "YYYY-MM-DDTHH:mm:ssZ").toDate()
> Thu Nov 19 2015 17:34:00 GMT-0800 (PST)
Run Code Online (Sandbox Code Playgroud)
时间应该是18:34,不是17:34。时区正在显示-08,什么时候应该显示-07
我正在尝试使用Firebase管理员SDK生成自定义令牌
const uid = '91f0bf4c-3e3c-441c-a21d-6a7fee341db5'
firebaseAdmin.auth().createCustomToken(uid)
Run Code Online (Sandbox Code Playgroud)
使用此特定的uid有时,自定义令牌会起作用,而有时在客户端上使用authWithCustomToken()时,会出现此错误:
“ auth / invalid-custom-token”自定义令牌格式不正确。请检查文档。”
有什么办法可以调试令牌的运行情况?从表面上看,“好”令牌和“坏”令牌看起来相同:
它们分为3部分,中间用 .
我有以下 docker-compose 配置:
version: '3'
services:
worker:
image: // image
logging:
driver: syslog
options:
syslog-address: "udp://XXX.papertrailapp.com:XXXX"
tag: "{{.Name}}/{{.ID}}"
Run Code Online (Sandbox Code Playgroud)
当我将其部署到 Ubuntu 下的 DigitalOcean 时,我可以成功运行命令,docker-compose up如下所示:
docker-compose -f docker-compose.yml up
Run Code Online (Sandbox Code Playgroud)
当该命令运行时,我可以看到以下输出:
worker_2_844fc7675414 | WARNING: no logs are available with the 'syslog' log driver
worker_1_5c91a3426046 | WARNING: no logs are available with the 'syslog' log driver
Run Code Online (Sandbox Code Playgroud)
看来 syslog 已正确配置为docker-compose up要运行的命令,但 syslog 驱动程序可能不可用?
我能找到的有关在 docker 中使用 syslog 的所有说明均参考docker run命令。但是如何让 syslog 与 docker-compose 一起工作呢?
当我创建一个div droppable并尝试设置一个drop事件函数时它不会触发:
$('.item').draggable({
});
$('.destination').droppable({
drop: function(event, ui){
console.log('hiii');
}
});
Run Code Online (Sandbox Code Playgroud)
当我将它放到$('.destination')div的右边时,它会触发,但如果我将它放在'.destination'div中,则不会触发它.看到完整的JS小提琴:http: //jsfiddle.net/dylanjha/8TFMS/5/
我正在使用node和grunt来处理从github克隆的现有JS项目.
npm install
grunt
Run Code Online (Sandbox Code Playgroud)
Grunt将我的浏览器启动到localhost:8000并打开索引页面.
索引页面加载,但是当浏览器尝试获取资产时,我收到所有403错误
Error: Forbidden
at SendStream.error (/Users/dylanjhaveri/code/skeuocard/node_modules/grunt-express/node_modules/connect/node_modules/send/lib/send.js:145:16)
at SendStream.pipe (/Users/dylanjhaveri/code/skeuocard/node_modules/grunt-express/node_modules/connect/node_modules/send/lib/send.js:310:52)
at Object.static (/Users/dylanjhaveri/code/skeuocard/node_modules/grunt-express/node_modules/connect/lib/middleware/static.js:84:8)
at next (/Users/dylanjhaveri/code/skeuocard/node_modules/grunt-express/node_modules/connect/lib/proto.js:190:15)
at Function.app.handle (/Users/dylanjhaveri/code/skeuocard/node_modules/grunt-express/node_modules/connect/lib/proto.js:198:3)
at Server.app (/Users/dylanjhaveri/code/skeuocard/node_modules/grunt-express/node_modules/connect/lib/connect.js:65:37)
at Server.EventEmitter.emit (events.js:98:17)
at HTTPParser.parser.onIncoming (http.js:2108:12)
at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:121:23)
at Socket.socket.ondata (http.js:1966:22)
Run Code Online (Sandbox Code Playgroud)