mirror of
https://github.com/versia-pub/frontend.git
synced 2025-12-06 16:38:20 +01:00
26 lines
526 B
TypeScript
26 lines
526 B
TypeScript
import type { LysandClient } from "@lysand-org/client";
|
|
|
|
type SSOProvider = {
|
|
id: string;
|
|
name: string;
|
|
icon: string;
|
|
};
|
|
|
|
export const useLinkedSSO = (client: MaybeRef<LysandClient>) => {
|
|
if (!client) {
|
|
return ref([] as SSOProvider[]);
|
|
}
|
|
|
|
const output = ref([] as SSOProvider[]);
|
|
|
|
watchEffect(() => {
|
|
toValue(client)
|
|
?.get<SSOProvider[]>("/api/v1/sso")
|
|
.then((res) => {
|
|
output.value = res.data;
|
|
});
|
|
});
|
|
|
|
return output;
|
|
};
|