Skip to content

Commit

Permalink
OHRM5X-2407: Change auth button logo selector
Browse files Browse the repository at this point in the history
  • Loading branch information
ManulMax committed Dec 18, 2023
1 parent 3f77de6 commit ef033f1
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ import {OxdText} from '@ohrm/oxd';
export default {
name: 'AuthButton',
props: {
url: {
type: String,
required: true,
},
color: {
type: String,
required: true,
Expand All @@ -42,7 +38,6 @@ export default {
h(
'a',
{
href: props.url,
title: props.label,
class: 'orangehrm-auth-button',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<auth-button
v-for="authenticator in socialAuthenticators"
:key="authenticator.id"
:url="authenticator.url"
:color="authenticator.color"
:label="authenticator.label"
:style="{
Expand Down Expand Up @@ -62,19 +61,18 @@ export default {
},
},

// TODO
setup(props) {
const http = new APIService(window.appGlobal.baseUrl, '');

const socialAuthenticators = computed(() => {
return props.authenticators.map((authenticator) => ({
...authenticator,
backgroundUrl: getBackgroundUrl(authenticator.label),
backgroundUrl: getBackgroundUrl(authenticator.url),
}));
});

const getBackgroundUrl = (label) => {
const lowercasedLabel = label.toLowerCase();
const getBackgroundUrl = (url) => {
const lowercasedLabel = url.toLowerCase();

switch (true) {
case lowercasedLabel.includes('google'):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public function preRender(Request $request): void
return [
'id' => $provider->getId(),
'label' => $provider->getProviderName(),
'url' => $provider->getProviderUrl(),
];
}, $providersArray);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
namespace OrangeHRM\OpenidAuthentication\Service;

use OrangeHRM\Entity\AuthProviderExtraDetails;
use OrangeHRM\Framework\Routing\UrlGenerator;
use OrangeHRM\Framework\Services;
use OrangeHRM\OpenidAuthentication\Dao\AuthProviderDao;
use OrangeHRM\OpenidAuthentication\OpenID\OpenIDConnectClient;
use OrangeHRM\OpenidAuthentication\Traits\Service\SocialMediaAuthenticationServiceTrait;
Expand All @@ -30,7 +32,6 @@ class SocialMediaAuthenticationService
private AuthProviderDao $authProviderDao;

public const SCOPE = 'email';
public const REDIRECT_URL = 'https://734d-2402-d000-a500-40f9-f1e8-1109-5f81-bcf4.ngrok-free.app/openidauth/openIdCredentials';

/**
* @return AuthProviderDao
Expand Down Expand Up @@ -66,7 +67,9 @@ public function initiateAuthentication(AuthProviderExtraDetails $provider, strin
*/
public function getRedirectURL(): string
{
return self::REDIRECT_URL;
/** @var UrlGenerator $urlGenerator */
$urlGenerator = $this->getContainer()->get(Services::URL_GENERATOR);
return $urlGenerator->generate('auth_oidc_login_redirect', [], UrlGenerator::ABSOLUTE_URL);
}

/**
Expand Down
39 changes: 0 additions & 39 deletions web/images/Github.svg

This file was deleted.

5 changes: 1 addition & 4 deletions web/images/default.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ef033f1

Please sign in to comment.