From cd9cbe55fca7bb73d8c35675aa12da6131b9037d Mon Sep 17 00:00:00 2001 From: eliasjpr Date: Wed, 9 Oct 2024 20:48:10 -0400 Subject: [PATCH] Streamline auth setup and clean up deprecated code Removed outdated server and settings files from the specs directory, consolidating configuration into the new `support/settings` path. This reduces redundancy and aligns the setup with best practices in handling authentication configuration. Additionally, unnecessary fetch for authorization code was eliminated from the handler, optimizing parameter parsing. These changes improve maintainability and clarity of the codebase. --- spec/spec_helper.cr | 2 +- spec/{ => support}/settings.cr | 0 spec/{server.cr => support/test_server.cr} | 0 src/authly/handler.cr | 1 - 4 files changed, 1 insertion(+), 2 deletions(-) rename spec/{ => support}/settings.cr (100%) rename spec/{server.cr => support/test_server.cr} (100%) diff --git a/spec/spec_helper.cr b/spec/spec_helper.cr index 873ffac..c6ee1a0 100644 --- a/spec/spec_helper.cr +++ b/spec/spec_helper.cr @@ -3,7 +3,7 @@ require "digest" require "base64" require "faker" require "../src/authly" -require "./settings" +require "./support/settings" process = nil Spec.before_suite do diff --git a/spec/settings.cr b/spec/support/settings.cr similarity index 100% rename from spec/settings.cr rename to spec/support/settings.cr diff --git a/spec/server.cr b/spec/support/test_server.cr similarity index 100% rename from spec/server.cr rename to spec/support/test_server.cr diff --git a/src/authly/handler.cr b/src/authly/handler.cr index b7b1148..bcd60b4 100644 --- a/src/authly/handler.cr +++ b/src/authly/handler.cr @@ -45,7 +45,6 @@ module Authly client_id = params.fetch("client_id", "") client_secret = params.fetch("client_secret", "") redirect_uri = params.fetch("redirect_uri", "") - authorization_code = params.fetch("code", "") username = params.fetch("username", "") password = params.fetch("password", "") refresh_token = params.fetch("refresh_token", "")