Newer
Older
Website-backend / lib / UserToken.rb
@lukas lukas on 9 Apr 2022 284 bytes add quotes for admins
class UserToken < JWT
    def initialize(user)
        super({
                'iss': `hostname`.tr("\n", ''),
                'dat': Time.now.getutc,
                'typ': 'usr',
                'usr': user.username,
                'admin': user.isAdmin,
            })
    end
end