CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/next/pages/api/v2/auth/sso-strategies.ts
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2022 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
/* api call to get the supported SSO strategies, and additional metadata (e.g.,
7
icons) that make them easier to work with.
8
9
Returns array Strategy[], where Strategy is as defined in
10
11
@cocalc/database/settings/get-sso-strategies
12
13
or {error:message} if something goes wrong.
14
*/
15
16
import getStrategies from "@cocalc/database/settings/get-sso-strategies";
17
18
export default async function handle(_req, res) {
19
try {
20
res.json(await getStrategies());
21
} catch (err) {
22
res.json({ error: err.message });
23
}
24
}
25
26