Add OAuth login support and streamline authentication flows
- Introduced `oauthLogin` method in `electron/preload.ts` and backend IPC handlers for OAuth via `BrowserWindow`. - Replaced web-based OAuth redirection with Electron-specific implementation for Google, Facebook, and Apple. - Refactored `SocialForm.tsx` to handle OAuth login success and token management via Electron. - Updated `User`, `QuillSense`, and context methods to include `quill-trial` subscriptions and extended login logic. - Cleaned up code, removed unused imports, and improved error handling for authentication scenarios.
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import {useContext} from "react";
|
||||
import React, {useContext} from "react";
|
||||
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
|
||||
import {faCoins, faDollarSign} from "@fortawesome/free-solid-svg-icons";
|
||||
import {AIUsageContext, AIUsageContextProps} from "@/context/AIUsageContext";
|
||||
|
||||
export default function CreditCounter({isCredit}: { isCredit: boolean }) {
|
||||
const {totalCredits, totalPrice} = useContext<AIUsageContextProps>(AIUsageContext)
|
||||
|
||||
|
||||
if (isCredit) {
|
||||
return (
|
||||
<div
|
||||
@@ -17,7 +17,7 @@ export default function CreditCounter({isCredit}: { isCredit: boolean }) {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<div
|
||||
className="flex items-center space-x-2 bg-secondary/50 rounded-xl px-3 py-2 border border-secondary/50 shadow-sm">
|
||||
|
||||
Reference in New Issue
Block a user