mirror of
https://github.com/domfelipe/mika-agent-assist.git
synced 2026-08-07 10:16:43 +00:00
Changes
Co-authored-by: domfelipe <53182096+domfelipe@users.noreply.github.com>
This commit is contained in:
parent
6048ddcfba
commit
46c723c018
3 changed files with 439 additions and 40 deletions
440
package-lock.json
generated
440
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -14,6 +14,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@cloudflare/vite-plugin": "^1.25.5",
|
"@cloudflare/vite-plugin": "^1.25.5",
|
||||||
"@hookform/resolvers": "^5.2.2",
|
"@hookform/resolvers": "^5.2.2",
|
||||||
|
"@lovable.dev/cloud-auth-js": "^1.1.1",
|
||||||
"@radix-ui/react-accordion": "^1.2.12",
|
"@radix-ui/react-accordion": "^1.2.12",
|
||||||
"@radix-ui/react-alert-dialog": "^1.1.15",
|
"@radix-ui/react-alert-dialog": "^1.1.15",
|
||||||
"@radix-ui/react-aspect-ratio": "^1.1.8",
|
"@radix-ui/react-aspect-ratio": "^1.1.8",
|
||||||
|
|
|
||||||
38
src/integrations/lovable/index.ts
Normal file
38
src/integrations/lovable/index.ts
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
// This file is auto-generated by Lovable. Do not modify it.
|
||||||
|
|
||||||
|
import { createLovableAuth } from "@lovable.dev/cloud-auth-js";
|
||||||
|
import { supabase } from "../supabase/client";
|
||||||
|
const lovableAuth = createLovableAuth();
|
||||||
|
|
||||||
|
type SignInOptions = {
|
||||||
|
redirect_uri?: string;
|
||||||
|
extraParams?: Record<string, string>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const lovable = {
|
||||||
|
auth: {
|
||||||
|
signInWithOAuth: async (provider: "google" | "apple" | "microsoft", opts?: SignInOptions) => {
|
||||||
|
const result = await lovableAuth.signInWithOAuth(provider, {
|
||||||
|
redirect_uri: opts?.redirect_uri,
|
||||||
|
extraParams: {
|
||||||
|
...opts?.extraParams,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (result.redirected) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result.error) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
await supabase.auth.setSession(result.tokens);
|
||||||
|
} catch (e) {
|
||||||
|
return { error: e instanceof Error ? e : new Error(String(e)) };
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
Loading…
Add table
Add a link
Reference in a new issue