Discord sign-in and basic accounts
Discord sign-in makes a basic account (Discord's verified email, no username or password) for T5DE's other sites; it finishes setting up with a username and password to use the hub. Implicit linking by email is off; members link Discord from their account page. Better Auth 1.7.26.
This commit is contained in:
1 parent
a66a3a4b6a
commit
f0a9661f8e
24 files changed
+5214
-173
No files matched your search
@@ -51,7 +51,7 @@ async function signUp(name: string) {
|
||||
}
|
||||
|
||||
test("closed: new accounts wait for approval; the first one runs the hub", async () => {
|
||||
expect((await call({ v: "" }, "GET", "/api/v1/hub")).json).toEqual({ registration: "closed" });
|
||||
expect((await call({ v: "" }, "GET", "/api/v1/hub")).json).toEqual({ registration: "closed", discord: false });
|
||||
const admin = await signUp("ada");
|
||||
expect((await call(admin, "GET", "/api/v1/me")).json.person).toMatchObject({ role: "admin", approved: true });
|
||||
expect((await call(admin, "GET", "/api/v1/account")).status).toBe(200);
|
||||
@@ -100,7 +100,7 @@ test("only admins open or close registration", async () => {
|
||||
expect((await call(mod, "PUT", "/api/v1/console/settings", { registration: "open" })).status).toBe(403);
|
||||
|
||||
expect((await call(admin, "PUT", "/api/v1/console/settings", { registration: "open" })).json).toEqual({ registration: "open" });
|
||||
expect((await call({ v: "" }, "GET", "/api/v1/hub")).json).toEqual({ registration: "open" });
|
||||
expect((await call({ v: "" }, "GET", "/api/v1/hub")).json).toEqual({ registration: "open", discord: false });
|
||||
// Open: new accounts can use the hub at once.
|
||||
const eve = await signUp("eve");
|
||||
expect((await call(eve, "GET", "/api/v1/account")).status).toBe(200);
|
||||
|
||||
Reference in new issue
Block a user