-
Notifications
You must be signed in to change notification settings - Fork 24
feat: Redesigns OAuth2 portal #404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
c26d644
d513554
e9a09c9
fa98ac2
3276439
828dd54
bdbfe0e
308b47c
6398053
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.form-container | ||
= bs_horizontal_simple_form_for(@application, url: doorkeeper_submit_path(@application)) do |f| | ||
= f.error_notification | ||
|
||
.form-inputs | ||
= f.input :name, required: true | ||
= f.input :redirect_uri, required: true | ||
= f.input :confidential | ||
= f.input :scopes | ||
|
||
.center | ||
= f.button :submit, class: 'btn-primary' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
= render "layouts/manage/page_title", title: @application.name, subtitle: t(:title, scope: 'doorkeeper.applications.edit') | ||
|
||
= render 'form' | ||
cbaudouinjr marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
= render "layouts/manage/page_title", title: t(:title, scope: 'pages.manage.doorkeeper'), docs: 'https://coderit.org/hackathon-manager/docs/busses' do | ||
= link_to t(:new, scope: 'doorkeeper.applications.index'), new_oauth_application_path, class: "btn btn-sm btn-outline-secondary" | ||
|
||
.mb-4 | ||
%table.table.table-striped.table-hover | ||
%thead | ||
%tr | ||
%th | ||
=t(:name, scope: 'doorkeeper.applications.index') | ||
cbaudouinjr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
%th | ||
=t(:callback_url, scope: 'doorkeeper.applications.index') | ||
cbaudouinjr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
%th | ||
=t(:confidential, scope: 'doorkeeper.applications.index') | ||
cbaudouinjr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
%tbody | ||
- @applications.each do |application| | ||
%tr | ||
%td | ||
%strong= link_to(application.name, oauth_application_path(application)) | ||
%td | ||
= simple_format(application.redirect_uri) | ||
%td | ||
= application.confidential? ? t('doorkeeper.applications.index.confidentiality.yes') : t('doorkeeper.applications.index.confidentiality.no') | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
= render "layouts/manage/page_title", title: t(:title, scope: 'doorkeeper.applications.new') | ||
|
||
= render 'form' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
= render "layouts/manage/page_title", title: @application.name, subtitle: t(:title, scope: 'doorkeeper.applications.show') do | ||
.btn-group | ||
= link_to t('doorkeeper.applications.buttons.edit'), edit_oauth_application_path(@application), class: 'btn btn-sm btn-outline-secondary' | ||
= link_to t('doorkeeper.applications.buttons.destroy'), oauth_application_path(@application), method: :delete, data: { confirm: t('doorkeeper.applications.confirmations.destroy', name: @application.name) }, class: 'btn btn-sm btn-outline-secondary' | ||
|
||
.row | ||
.col-lg-6 | ||
%h4.border-bottom.pb-2.mb-3 Details | ||
%dl.row | ||
%dt.col-md-4 | ||
= t('.application_id') | ||
%dd.col-md-8 | ||
%code#application_id.bg-light | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
= @application.uid | ||
cbaudouinjr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
%dt.col-md-4 | ||
= t('.secret') | ||
%dd.col-md-8 | ||
%code#application_id.bg-light | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
= flash[:application_secret].presence || @application.plaintext_secret | ||
cbaudouinjr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
%dt.col-md-4 | ||
= t('.scopes') | ||
%dd.col-md-8 | ||
- if @application.scopes.present? | ||
= @application.scopes | ||
- else | ||
%bg-light.font-italic.text-muted | ||
= t('.not_defined') | ||
%dt.col-md-4 | ||
= t('.confidential') | ||
%dd.col-md-8 | ||
= @application.confidential? ? "Yes" : "No" | ||
|
||
.col-lg-6 | ||
.h4.border-bottom.pb-2.mb-3 | ||
= t('.callback_urls') | ||
%table.table.table-striped.table-hover | ||
%tbody | ||
- @application.redirect_uri.split.each do |uri| | ||
%tr | ||
%td | ||
= uri | ||
%td | ||
= link_to t('doorkeeper.applications.buttons.authorize'), oauth_authorization_path(client_id: @application.uid, redirect_uri: uri, response_type: 'code', scope: @application.scopes), class: 'btn btn-sm btn-outline-primary', target: '_blank' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just you watch this trigger CodeClimate |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.form-container | ||
#disclaimer | ||
%h1.section-title | ||
Authorization | ||
%span.emphasized Error | ||
%p | ||
= @pre_auth.error_response.body[:error_description] | ||
%p | ||
= raw t('doorkeeper.errors.messages.get_help', hackathon_name: content_tag(:strong, class: 'text-info') { HackathonConfig['name'] }) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
.form-container | ||
#disclaimer | ||
%h1.section-title | ||
Authorization | ||
%span.emphasized Required | ||
%p | ||
= raw t('.prompt', client_name: content_tag(:strong, class: 'text-info') { @pre_auth.client.name }) | ||
%p | ||
= t('.able_to') | ||
.actions | ||
= form_tag oauth_authorization_path, method: :delete, style: "padding-right: 10px;" do | ||
= hidden_field_tag :client_id, @pre_auth.client.uid | ||
= hidden_field_tag :redirect_uri, @pre_auth.redirect_uri | ||
= hidden_field_tag :state, @pre_auth.state | ||
= hidden_field_tag :response_type, @pre_auth.response_type | ||
= hidden_field_tag :scope, @pre_auth.scope | ||
= hidden_field_tag :code_challenge, @pre_auth.code_challenge | ||
= hidden_field_tag :code_challenge_method, @pre_auth.code_challenge_method | ||
= submit_tag t('doorkeeper.authorizations.buttons.deny') | ||
= form_tag oauth_authorization_path, method: :post do | ||
= hidden_field_tag :client_id, @pre_auth.client.uid | ||
= hidden_field_tag :redirect_uri, @pre_auth.redirect_uri | ||
= hidden_field_tag :state, @pre_auth.state | ||
= hidden_field_tag :response_type, @pre_auth.response_type | ||
= hidden_field_tag :scope, @pre_auth.scope | ||
= hidden_field_tag :code_challenge, @pre_auth.code_challenge | ||
= hidden_field_tag :code_challenge_method, @pre_auth.code_challenge_method | ||
= submit_tag t('doorkeeper.authorizations.buttons.authorize') | ||
cbaudouinjr marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<%- submit_btn_css ||= 'btn btn-link' %> | ||
<%= form_tag oauth_authorized_application_path(application), method: :delete do %> | ||
<%= submit_tag t('doorkeeper.authorized_applications.buttons.revoke'), onclick: "return confirm('#{ t('doorkeeper.authorized_applications.confirmations.revoke') }')", class: submit_btn_css %> | ||
<% end %> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<header class="page-header"> | ||
peterkos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<h1><%= t('doorkeeper.authorized_applications.index.title') %></h1> | ||
</header> | ||
|
||
<main role="main"> | ||
<table class="table table-striped"> | ||
<thead> | ||
<tr> | ||
<th><%= t('doorkeeper.authorized_applications.index.application') %></th> | ||
<th><%= t('doorkeeper.authorized_applications.index.created_at') %></th> | ||
<th></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% @applications.each do |application| %> | ||
<tr> | ||
<td><%= application.name %></td> | ||
<td><%= application.created_at.strftime(t('doorkeeper.authorized_applications.index.date_format')) %></td> | ||
<td><%= render 'delete_form', application: application %></td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
</main> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
- homepage_url = HackathonConfig['homepage_url'].presence || root_path | ||
.header | ||
.header__wrapper.account-nav__wrapper | ||
- if HackathonConfig['logo_asset'].present? | ||
.header-logo | ||
= image_tag HackathonConfig['logo_asset'], id: 'logo', alt: "#{HackathonConfig['name']} logo", title: HackathonConfig['name'], class: 'header-logo__image' | ||
.header-nav.end | ||
- if user_signed_in? | ||
= btn_link_to "Sign Out", destroy_user_session_path, method: :delete |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
!!! 5 | ||
%html | ||
%head | ||
%title= yield(:title) || HackathonConfig['default_page_title'] | ||
%meta{ charset: "utf-8" } | ||
%meta{ name:"viewport", content: "width=device-width, initial-scale=1" } | ||
|
||
- if HackathonConfig['favicon_asset'].present? | ||
%link{ href: image_url(HackathonConfig['favicon_asset']), rel: "shortcut icon" } | ||
|
||
= csrf_meta_tags | ||
= csp_meta_tag | ||
|
||
= stylesheet_link_tag "application", media: "all", 'data-turbolinks-track': 'reload' | ||
= javascript_include_tag "application", 'data-turbolinks-track': 'reload' | ||
%link{ href:'//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700', rel: 'stylesheet', type: 'text/css' } | ||
- if HackathonConfig['custom_css'].present? | ||
%style | ||
= HackathonConfig['custom_css'] | ||
|
||
%body | ||
= render "layouts/doorkeeper/header" | ||
= render "layouts/flashes" | ||
#main | ||
%section.section | ||
.container | ||
= yield |
Uh oh!
There was an error while loading. Please reload this page.