aboutsummaryrefslogtreecommitdiff
path: root/lib/vnlib.browser/src/social/index.ts
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2024-03-24 21:15:47 -0400
committerLibravatar vnugent <public@vaughnnugent.com>2024-03-24 21:15:47 -0400
commit27b487b6d0befdb2197a58ceadb1f1ac2b337786 (patch)
tree0714fbc25aef9b8a98d747849b2502031bfb9867 /lib/vnlib.browser/src/social/index.ts
parentf2ac807486a00db4ba8486133d567e392f0fe98a (diff)
Squashed commit of the following:
commit 2a114541a3bfddae887adaa98c1ed326b125d511 Author: vnugent <public@vaughnnugent.com> Date: Sun Mar 24 20:53:38 2024 -0400 refactor: pull apart session authorization for future dev commit f8aea6453ddb2d56c1ce2ecb6a9e67d1af523c2e Author: vnugent <public@vaughnnugent.com> Date: Thu Mar 21 14:33:21 2024 -0400 feat: Add optional svg base64 icons for social OAuth2 connections commit cc29bed99dc9e151315cce75e50d55dca306b532 Author: vnugent <public@vaughnnugent.com> Date: Sun Mar 10 21:58:27 2024 -0400 source tree project location updated
Diffstat (limited to 'lib/vnlib.browser/src/social/index.ts')
-rw-r--r--lib/vnlib.browser/src/social/index.ts13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/vnlib.browser/src/social/index.ts b/lib/vnlib.browser/src/social/index.ts
index dac3cc9..7d80687 100644
--- a/lib/vnlib.browser/src/social/index.ts
+++ b/lib/vnlib.browser/src/social/index.ts
@@ -55,6 +55,7 @@ export interface SocialOAuthPortal {
readonly id: string;
readonly login: string;
readonly logout?: string;
+ readonly icon?: string;
}
/**
@@ -67,6 +68,10 @@ export interface OAuthMethod {
*/
readonly id: string;
/**
+ * Optional bas64encoded icon image url for the method
+ */
+ readonly icon?: string;
+ /**
* Determines if the current flow is active for this method
*/
isActiveLogin(): boolean
@@ -90,6 +95,10 @@ export interface SocialOauthMethod {
*/
readonly id: string
/**
+ * Optional bas64encoded icon image url for the method
+ */
+ readonly icon?: string
+ /**
* The endpoint to submit the authentication request to
*/
loginUrl(): string
@@ -214,7 +223,8 @@ export const fromSocialConnections = <T extends SocialOauthMethod>(methods: T[],
return map(methods, method => {
return{
id: method.id,
-
+ icon: method.icon,
+
async beginLoginFlow() {
//Prepare the login claim`
const claim = await prepareLogin()
@@ -314,6 +324,7 @@ export const fromSocialPortals = (portals: SocialOAuthPortal[]): SocialOauthMeth
return map(portals, p => {
return {
id: p.id,
+ icon: p.icon,
loginUrl : () => p.login,
//Get the logout data from the server
getLogoutData: () => ({ url: p.logout!, args: {}}),