This commit is contained in:
2026-01-30 07:55:55 +01:00
parent 7169e467cc
commit b6fa30a3f2
10 changed files with 80 additions and 71 deletions
+2
View File
@@ -8,6 +8,7 @@ import googleAuth from "../../actions/users/social/google-auth";
import updateUser from "../../actions/users/update-user";
import userAuth from "../../actions/users/user-auth";
import validateTempEmailCode from "../../actions/users/validate-temp-email-code";
import githubLogin from "../../functions/api/social-login/githubLogin";
const user = {
auth: {
@@ -18,6 +19,7 @@ const user = {
update: updateUser,
resetPassword: resetPassword,
googleLogin: googleAuth,
githubLoginFn: githubLogin,
logout: logoutUser,
auth: userAuth,
validateTempEmailCode,
@@ -1,40 +1,7 @@
import { GithubUserPayload } from "../../../types";
import dbHandler from "../../backend/dbHandler";
import httpsRequest from "../../backend/httpsRequest";
export interface GithubUserPayload {
login: string;
id: number;
node_id: string;
avatar_url: string;
gravatar_id: string;
url: string;
html_url: string;
followers_url: string;
following_url: string;
gists_url: string;
starred_url: string;
subscriptions_url: string;
organizations_url: string;
repos_url: string;
received_events_url: string;
type: string;
site_admin: boolean;
name: string;
company: string;
blog: string;
location: string;
email: string;
hireable: string;
bio: string;
twitter_username: string;
public_repos: number;
public_gists: number;
followers: number;
following: number;
created_at: string;
updated_at: string;
}
type Param = {
code: string;
clientId: string;
@@ -92,10 +59,10 @@ export default async function githubLogin({
gitHubUser.email = existingGithubUser[0].email;
}
}
} catch (/** @type {any} */ error: any) {
} catch (error: any) {
console.log(
"ERROR in githubLogin.ts backend function =>",
error.message
error.message,
);
}
+34
View File
@@ -3101,3 +3101,37 @@ export type AddDbEntryParamOnDuplicate = {
sql: string;
values?: string[];
};
export interface GithubUserPayload {
login: string;
id: number;
node_id: string;
avatar_url: string;
gravatar_id: string;
url: string;
html_url: string;
followers_url: string;
following_url: string;
gists_url: string;
starred_url: string;
subscriptions_url: string;
organizations_url: string;
repos_url: string;
received_events_url: string;
type: string;
site_admin: boolean;
name: string;
company: string;
blog: string;
location: string;
email: string;
hireable: string;
bio: string;
twitter_username: string;
public_repos: number;
public_gists: number;
followers: number;
following: number;
created_at: string;
updated_at: string;
}