Sha256: c4a68fe7f8fdd7fd22fee06562a64537327badbd08ef6931a1b78ef108cb385d
Contents?: true
Size: 1.15 KB
Versions: 17
Compression:
Stored size: 1.15 KB
Contents
module OpenStax module Accounts module Dev class AccountsController < OpenStax::Accounts::Dev::BaseController # Allow accessing from inside an iframe before_action :allow_iframe_access, only: :index def index handle_with AccountsSearch end def create handle_with( AccountsCreate, success: -> do username = @handler_result.outputs.account.username flash.notice = "Account with username \"#{username}\" created." redirect_to dev_accounts_path(search: { query: username }) end, failure: -> do flash.alert = @handler_result.errors.first.translate redirect_to dev_accounts_path(search: { query: params.dig(:create, :username) }) end ) end def become @account = Account.find(params[:id]) sign_in @account redirect_back key: :accounts_return_to, strategies: [:session] end private def allow_iframe_access response.headers.except! 'X-Frame-Options' end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems