# app/helpers/application_helper.rbdefchat_tokenpayload={jti: current_user.id.to_s,iss: current_user.nickname,sub: Digest::MD5.hexdigest(current_user.email)[0...3].upcase,adi: Settings.roles.chatroom.admin.include?(current_user.email)}JWT.encodepayload,'xxx','HS256'end# app/views/welcome/index.html.erb
<iframeframeborder="0" name="Iframe1" src="https://bcachat.com:4443/?xtoken=<%= chat_token %>" width="100%" height="350"></iframe>
# web/controllers/page_controller.ex{:ok,claims}=JsonWebToken.verify(jwt,%{key: "xxx"})