Skip to content

Commit

Permalink
Updated APP_ENV in example.env
Browse files Browse the repository at this point in the history
Adjusted lighthouse test / auth
  • Loading branch information
warrenchristian1telus committed Oct 1, 2024
1 parent 4c3ed2f commit f82108e
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ jobs:
uses: browser-actions/setup-chrome@latest
with:
install-dependencies: false
- name: Lighthouse
- name: Run Lighthouse Tests
id: lighthouse
run: |
sleep 120 # Wait for the deployment to be ready
Expand Down
8 changes: 4 additions & 4 deletions app/Http/Controllers/Auth/AuthenticatedSessionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function store(LoginRequest $request)
// Write to access log
\App\Models\AccessLog::create([
'user_id' => $user->id,
'login_at' => Carbon::now(),
'login_at' => Carbon::now(),
'login_ip' => $request->getClientIp(),
'login_method' => 'Laravel UI',
]);
Expand Down Expand Up @@ -112,7 +112,7 @@ protected function canLoginIn($request, $auth_user)
}
}

// Step 1: find the Authenicated User by GUID
// Step 1: find the Authenicated User by GUID
// $isUser = User::where('source_type', 'HCM')
// ->where('guid', $guid)
// ->where('acctlock', 0)->first();
Expand All @@ -132,7 +132,7 @@ protected function canLoginIn($request, $auth_user)
} else {
return false;
}

}

protected function assignSupervisorRole(User $user)
Expand All @@ -143,7 +143,7 @@ protected function assignSupervisorRole(User $user)
$isManager = false;
$hasSharedProfile = false;

// To determine the login user whether is manager or not
// To determine the login user whether is manager or not
$mgr = User::where('reporting_to', $user->id)->first();
if ($mgr) {
$isManager = true;
Expand Down
2 changes: 1 addition & 1 deletion example.env
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ CRON_NAME=cron
WEB_NAME=web
REDIS_NAME=redis

APP_ENV=local
APP_ENV=production
APP_KEY=base64:**Add_app_key_here**
APP_DEBUG=true
APP_URL=http://localhost:8080
Expand Down
10 changes: 5 additions & 5 deletions openshift/config/lighthouse/lighthouse-auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ async function runLighthouse(url, options, config = null) {
}

// Check if the username field exists
const usernameField = await page.$('input[name="email"]');
const usernameField = await page.$('#admin-login input[name="email"]');
if (!usernameField) {
throw new Error('No element found for selector: #username');
throw new Error('No element found for selector: #admin-login input[name="email"]');
}
await usernameField.type(username);

// Check if the password field exists
const passwordField = await page.$('input[name="password"]');
const passwordField = await page.$('#admin-login input[name="password"]');
if (!passwordField) {
throw new Error('No element found for selector: #password');
throw new Error('No element found for selector: #admin-login input[name="password"]');
}
await page.type('#password', password);

Expand All @@ -63,7 +63,7 @@ async function runLighthouse(url, options, config = null) {

// Wait for both the click and navigation
await Promise.all([
page.click('button[type="submit"]'),
page.click('#admin-login button[type="submit"]'),
page.waitForNavigation({timeout: 60000}),
]);

Expand Down
20 changes: 9 additions & 11 deletions routes/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@
use App\Http\Controllers\Auth\EmailVerificationNotificationController;
use App\Http\Controllers\Auth\KeycloakLoginController;



Route::get('login/{provider}', [KeycloakLoginController::class, 'redirectToProvider'])
->middleware('guest')->name('keycloak-login');
->middleware('guest')->name('keycloak-login');
Route::get('login/{provider}/callback', [KeycloakLoginController::class, 'handleProviderCallback']);
Route::post('/logout', [KeycloakLoginController::class, 'destroy'])
->middleware('auth')->name('logout');
->middleware('auth')->name('logout');

//Route::get('/login/microsoft', [AzureLoginController::class, 'login'])->name('ms-login');

Expand All @@ -37,22 +35,22 @@
// //->middleware('auth')
// ->name('logout');

/*
/*
Route::get('/register', [RegisteredUserController::class, 'create'])
->middleware('guest')
->name('register');
Route::post('/register', [RegisteredUserController::class, 'store'])
->middleware('guest');
->middleware('guest');
*/

Route::get('/login', [AuthenticatedSessionController::class, 'create'])
->middleware('guest')
->name('login');
->middleware('guest')
->name('login');

Route::post('/login', [AuthenticatedSessionController::class, 'store'])
->middleware('guest');
/*
->middleware('guest');
/*
Route::get('/forgot-password', [PasswordResetLinkController::class, 'create'])
->middleware('guest')
->name('password.request');
Expand Down Expand Up @@ -92,4 +90,4 @@
Route::post('/logout', [AuthenticatedSessionController::class, 'destroy'])
->middleware('auth')
->name('logout');
*/
*/

0 comments on commit f82108e

Please sign in to comment.