Sha256: 7b382ed25062f320675eacb42ae094e65d4c9fdfd1866dfb38b950c7caa24c22

Contents?: true

Size: 623 Bytes

Versions: 5

Compression:

Stored size: 623 Bytes

Contents

# frozen_string_literal: true

require 'jwt'

module Osso
  class Admin < Sinatra::Base
    include AppConfig
    helpers Helpers::Auth

    before do
      chomp_token
    end

    get '/' do
      admin_protected!

      erb :'public/index'
    end

    get '/enterprise' do
      admin_protected!

      erb :admin
    end

    get '/enterprise/:domain' do
      enterprise_protected!(params[:domain])

      @enterprise = Models::EnterpriseAccount.where(
        domain: params[:domain],
      ).first_or_create

      erb :admin
    end

    get '/config' do
      admin_protected!

      erb :admin
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
osso-0.0.3.3 lib/osso/routes/admin.rb
osso-0.0.3 lib/osso/routes/admin.rb
osso-0.0.2.10 lib/osso/routes/admin.rb
osso-0.0.2.9 lib/osso/routes/admin.rb
osso-0.0.2.8 lib/osso/routes/admin.rb