fix: support local workshop authentication
This commit is contained in:
13 files changed
+42
-6
No files matched your search
@@ -109,6 +109,18 @@ export class WorkshopClient {
|
||||
}
|
||||
|
||||
async signInWithGitHub() {
|
||||
let methods: Awaited<ReturnType<ReturnType<PocketBase["collection"]>["listAuthMethods"]>>;
|
||||
try {
|
||||
methods = await this.pocketBase.collection("users").listAuthMethods();
|
||||
} catch (error) {
|
||||
throw asWorkshopError(error, "Failed to load Workshop authentication methods");
|
||||
}
|
||||
if (!methods.oauth2.providers.some((provider) => provider.name === "github")) {
|
||||
throw new WorkshopError(
|
||||
"unavailable",
|
||||
"GitHub login is not configured. Set GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET, then restart Workshop.",
|
||||
);
|
||||
}
|
||||
try {
|
||||
await this.pocketBase.collection("users").authWithOAuth2({ provider: "github" });
|
||||
return this.currentUser;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { customWidgetImportSchema } from "@homarr/validation/custom-widget";
|
||||
import { z } from "zod";
|
||||
|
||||
export const WORKSHOP_API_URL = "https://store.homarr.dev";
|
||||
export const WORKSHOP_API_URL = "https://workshop.homarr.dev";
|
||||
export const WORKSHOP_WEB_URL = "https://homarr.dev/workshop";
|
||||
export const WIDGET_SCHEMA_VERSION = "homarr-custom-widget-v2";
|
||||
export const CSS_SCHEMA_VERSION = "homarr-custom-css-v1";
|
||||
|
||||
Reference in new issue
Block a user