Skip to content

Commit

Permalink
fix: show social login icon
Browse files Browse the repository at this point in the history
  • Loading branch information
krantheman committed Oct 18, 2024
1 parent 38f7854 commit ca94e91
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
5 changes: 3 additions & 2 deletions frontend/src/views/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
class="flex items-center justify-center gap-2 transition-colors focus:outline-none text-gray-800 bg-gray-100 hover:bg-gray-200 active:bg-gray-300 focus-visible:ring focus-visible:ring-gray-400 h-7 text-base p-2 rounded"
:href="provider.auth_url"
>
Login with {{ provider.provider_name }}
<img class="h-4 w-4" :src="provider.icon" :alt="provider.provider_name" />
<span>Login with {{ provider.provider_name }}</span>
</a>
</div>
</template>
Expand Down Expand Up @@ -159,5 +160,5 @@ async function submit(e) {
const authProviders = createResource({
url: "hrms.api.oauth.oauth_providers",
auto: true,
});
})
</script>
9 changes: 1 addition & 8 deletions hrms/api/oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,13 @@ def oauth_providers():
if not client_secret:
continue

icon = None
if provider.icon:
if provider.provider_name == "Custom":
icon = get_icon_html(provider.icon, small=True)
else:
icon = f"<img src='{provider.icon}' alt='{provider.provider_name}'>"

if provider.client_id and provider.base_url and get_oauth_keys(provider.name):
out.append(
{
"name": provider.name,
"provider_name": provider.provider_name,
"auth_url": get_oauth2_authorize_url(provider.name, "/hrms"),
"icon": icon,
"icon": provider.icon,
}
)

Expand Down

0 comments on commit ca94e91

Please sign in to comment.