Rewritten using quasar framework

This commit is contained in:
2022-11-30 00:37:19 +10:00
commit bca211f706
116 changed files with 6346 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
class JsonWebToken
SECRET_KEY = Rails.application.secrets.secret_key_base.to_s
def self.encode(payload, exp = 24.hours.from_now)
payload[:exp] = exp.to_i
JWT.encode(payload, SECRET_KEY)
end
def self.decode(token)
decoded = JWT.decode(token, SECRET_KEY)[0]
HashWithIndifferentAccess.new decoded
end
end