Skip to content

Commit

Permalink
fix auth providers
Browse files Browse the repository at this point in the history
  • Loading branch information
prostgles committed Nov 24, 2024
1 parent 928f830 commit 4a482e8
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/Auth/AuthTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export type AuthRegistrationConfig = RegistrationProviders & {
/**
* Do something with the registered user
*/
onRegister: (data: RegistrationData) => Promise<any>;
onRegister: (data: RegistrationData) => void | Promise<any>;
};

export type SessionUser<ServerUser extends UserLike = UserLike, ClientUser extends UserLike = UserLike> = {
Expand Down
3 changes: 2 additions & 1 deletion lib/Auth/setAuthSignup.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Auth } from './AuthTypes';
import passport from "passport";
/** For some reason normal import is undefined */
const passport = require("passport") as typeof import("passport");
import { Strategy as GoogleStrategy } from "passport-google-oauth20";
import { Strategy as GitHubStrategy } from "passport-github2";
import { Strategy as MicrosoftStrategy } from "passport-microsoft";
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "prostgles-server",
"version": "4.2.139",
"version": "4.2.140",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
8 changes: 8 additions & 0 deletions tests/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,14 @@ function dd(){
log(req.originalUrl)
res.sendFile(path.join(__dirname, '../../index.html'));
},
registrations: {
websiteUrl: "http://localhost:3000",
github: {
clientID: "GITHUB_CLIENT_ID",
clientSecret: "GITHUB"
},
onRegister: console.log
},
}
},
publishMethods: async (params) => {
Expand Down
2 changes: 1 addition & 1 deletion tests/server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4a482e8

Please sign in to comment.