Skip to content

Commit e1b2f2c

Browse files
committed
Merge branch 'develop' of https://github.com/OpenNBS/NoteBlockWorld into feature/login-by-email
2 parents 70c3b73 + cbc9206 commit e1b2f2c

File tree

8 files changed

+21
-1903
lines changed

8 files changed

+21
-1903
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<p align="center">
2-
<img src="img/header.png" alt="Note Block World header" />
2+
<a href="https://noteblock.world">
3+
<img src="img/header.png" alt="Note Block World header" />
4+
</a>
35
</p>
46

57
<p align="center">
@@ -9,15 +11,15 @@
911
</p>
1012

1113
<p align="center">
12-
👥 <a href="https://discord.gg/open-note-block-studio-608692895179997252">Discord</a> •
14+
👥 <a href="https://discord.gg/note-block-world-608692895179997252">Discord</a> •
1315
📆 <a href="https://github.com/orgs/OpenNBS/projects/4">Roadmap</a> •
1416
🗨 <a href="https://github.com/OpenNBS/NoteBlockWorld/issues/new/choose">Feedback</a> •
1517
☕ <a href="https://opencollective.com/opennbs/donate">Buy us a coffee!</a>
1618
</p>
1719

1820
## ℹ About the project
1921

20-
**Note Block World** is a collaborative, social website where users can share their note block songs made with [Note Block Studio](https://noteblock.studio/). Our goal is to give the NBS community a platform to share their creations with the world, discover new music and connect with other creators!
22+
[**Note Block World**](https://noteblock.world/) is a collaborative, social website where users can share their note block songs made with [Note Block Studio](https://noteblock.studio/). Our goal is to give the NBS community a platform to share their creations with the world, discover new music and connect with other creators!
2123

2224
## 💬 Issues/Feedback
2325

@@ -27,7 +29,7 @@ If you have found an issue or would like to suggest a feature, please open a [ne
2729

2830
We welcome contributions to the project! Read our [contributor guide](CONTRIBUTING.md) to set up the project and get started.
2931

30-
Please [open an issue](/issues/new/choose) discussing the changes you would like to make before submitting a pull request. Alternatively, you can join our [Discord server](https://discord.gg/open-note-block-studio-608692895179997252) to discuss the changes with our development team!
32+
Please [open an issue](/issues/new/choose) discussing the changes you would like to make before submitting a pull request. Alternatively, you can join our [Discord server](https://discord.gg/note-block-world-608692895179997252) to discuss the changes with our development team!
3133

3234
## ❤ Donate
3335

@@ -38,6 +40,7 @@ Thanks to all our current and past sponsors for helping us keep Note Block World
3840
###### Supporters
3941

4042
<img src="https://opencollective.com/opennbs/backers.svg" height="48px"/>
43+
<img src="https://opencollective.com/opennbs/sponsors.svg" height="48px"/>
4144

4245
---
4346

pnpm-lock.yaml

Lines changed: 0 additions & 1786 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"@aws-sdk/client-s3": "^3.717.0",
2424
"@aws-sdk/s3-request-presigner": "^3.717.0",
2525
"@encode42/nbs.js": "^5.0.2",
26-
"@nestjs-modules/mailer": "^2.0.2",
2726
"@nestjs/common": "^10.4.15",
2827
"@nestjs/config": "^3.3.0",
2928
"@nestjs/core": "^10.4.15",
@@ -32,7 +31,6 @@
3231
"@nestjs/passport": "^10.0.3",
3332
"@nestjs/platform-express": "^10.4.15",
3433
"@nestjs/swagger": "^7.4.2",
35-
"@nestjs/throttler": "^6.3.0",
3634
"@types/passport-discord": "^0.1.14",
3735
"@types/uuid": "^9.0.8",
3836
"axios": "^1.7.9",
@@ -50,7 +48,6 @@
5048
"passport-google-oauth20": "^2.0.0",
5149
"passport-jwt": "^4.0.1",
5250
"passport-local": "^1.0.0",
53-
"passport-magic-login": "^1.2.2",
5451
"reflect-metadata": "^0.1.14",
5552
"rxjs": "^7.8.1",
5653
"uuid": "^9.0.1",

server/src/auth/auth.module.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export class AuthModule {
2323
ConfigModule.forRoot(),
2424
MailingModule,
2525
JwtModule.registerAsync({
26-
imports: [ConfigModule],
2726
inject: [ConfigService],
27+
imports: [ConfigModule],
2828
useFactory: async (config: ConfigService) => {
2929
const JWT_SECRET = config.get('JWT_SECRET');
3030
const JWT_EXPIRES_IN = config.get('JWT_EXPIRES_IN');
@@ -61,58 +61,58 @@ export class AuthModule {
6161
configService.getOrThrow<string>('COOKIE_EXPIRES_IN'),
6262
},
6363
{
64-
provide: 'SERVER_URL',
6564
inject: [ConfigService],
65+
provide: 'SERVER_URL',
6666
useFactory: (configService: ConfigService) =>
6767
configService.getOrThrow<string>('SERVER_URL'),
6868
},
6969
{
70-
provide: 'MAGIC_LINK_SECRET',
7170
inject: [ConfigService],
71+
provide: 'MAGIC_LINK_SECRET',
7272
useFactory: (configService: ConfigService) =>
7373
configService.getOrThrow<string>('MAGIC_LINK_SECRET'),
7474
},
7575
{
76-
provide: 'FRONTEND_URL',
7776
inject: [ConfigService],
77+
provide: 'FRONTEND_URL',
7878
useFactory: (configService: ConfigService) =>
7979
configService.getOrThrow<string>('FRONTEND_URL'),
8080
},
8181
{
82-
provide: 'JWT_SECRET',
8382
inject: [ConfigService],
83+
provide: 'JWT_SECRET',
8484
useFactory: (configService: ConfigService) =>
8585
configService.getOrThrow<string>('JWT_SECRET'),
8686
},
8787
{
88-
provide: 'JWT_EXPIRES_IN',
8988
inject: [ConfigService],
89+
provide: 'JWT_EXPIRES_IN',
9090
useFactory: (configService: ConfigService) =>
9191
configService.getOrThrow<string>('JWT_EXPIRES_IN'),
9292
},
9393
{
94-
provide: 'JWT_REFRESH_SECRET',
9594
inject: [ConfigService],
95+
provide: 'JWT_REFRESH_SECRET',
9696
useFactory: (configService: ConfigService) =>
9797
configService.getOrThrow<string>('JWT_REFRESH_SECRET'),
9898
},
9999
{
100-
provide: 'JWT_REFRESH_EXPIRES_IN',
101100
inject: [ConfigService],
101+
provide: 'JWT_REFRESH_EXPIRES_IN',
102102
useFactory: (configService: ConfigService) =>
103103
configService.getOrThrow<string>('JWT_REFRESH_EXPIRES_IN'),
104104
},
105105
{
106-
provide: 'WHITELISTED_USERS',
107106
inject: [ConfigService],
107+
provide: 'WHITELISTED_USERS',
108108
useFactory: (configService: ConfigService) =>
109109
configService.getOrThrow<string>('WHITELISTED_USERS'),
110110
},
111111
{
112-
provide: 'APP_DOMAIN',
113112
inject: [ConfigService],
113+
provide: 'APP_DOMAIN',
114114
useFactory: (configService: ConfigService) =>
115-
configService.getOrThrow<string>('APP_DOMAIN'),
115+
configService.get<string>('APP_DOMAIN'),
116116
},
117117
],
118118
exports: [AuthService],

server/src/auth/auth.service.spec.ts

Lines changed: 0 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -226,52 +226,6 @@ describe('AuthService', () => {
226226
}); // TODO: implement tests for googleLogin
227227

228228
describe('githubLogin', () => {
229-
it('should generate token and redirect if user is whitelisted', async () => {
230-
const req: Partial<Request> = {
231-
user: {
232-
accessToken: 'test-access-token',
233-
profile: {
234-
username: 'testuser',
235-
photos: [{ value: 'http://example.com/photo.jpg' }],
236-
},
237-
} as GithubAccessToken,
238-
};
239-
240-
const res: Partial<Response> = {
241-
redirect: jest.fn(),
242-
};
243-
244-
jest.spyOn(authService as any, 'verifyWhitelist').mockResolvedValue(true);
245-
246-
jest
247-
.spyOn(authService as any, 'verifyAndGetUser')
248-
.mockResolvedValue({ id: 'user-id' });
249-
250-
jest
251-
.spyOn(authService as any, 'GenTokenRedirect')
252-
.mockImplementation((user, res: any) => {
253-
res.redirect('/dashboard');
254-
});
255-
256-
mockAxios.get.mockResolvedValue({
257-
data: [{ email: '[email protected]', primary: true }],
258-
} as any);
259-
260-
await authService.githubLogin(req as Request, res as Response);
261-
262-
expect((authService as any).verifyWhitelist).toHaveBeenCalledWith(
263-
'testuser',
264-
);
265-
266-
expect((authService as any).verifyAndGetUser).toHaveBeenCalledWith({
267-
username: 'testuser',
268-
269-
profileImage: 'http://example.com/photo.jpg',
270-
});
271-
272-
expect(res.redirect).toHaveBeenCalledWith('/dashboard');
273-
});
274-
275229
it('should redirect to login if user is not whitelisted', async () => {
276230
const req: Partial<Request> = {
277231
user: {
@@ -304,50 +258,6 @@ describe('AuthService', () => {
304258
});
305259

306260
describe('discordLogin', () => {
307-
it('should generate token and redirect if user is whitelisted', async () => {
308-
const req: Partial<Request> = {
309-
user: {
310-
profile: {
311-
id: 'discord-user-id',
312-
username: 'testuser',
313-
314-
avatar: 'avatar-hash',
315-
},
316-
} as DiscordUser,
317-
};
318-
319-
const res: Partial<Response> = {
320-
redirect: jest.fn(),
321-
};
322-
323-
jest.spyOn(authService as any, 'verifyWhitelist').mockResolvedValue(true);
324-
325-
jest
326-
.spyOn(authService as any, 'verifyAndGetUser')
327-
.mockResolvedValue({ id: 'user-id' });
328-
329-
jest
330-
.spyOn(authService as any, 'GenTokenRedirect')
331-
.mockImplementation((user, res: any) => {
332-
res.redirect('/dashboard');
333-
});
334-
335-
await authService.discordLogin(req as Request, res as Response);
336-
337-
expect((authService as any).verifyWhitelist).toHaveBeenCalledWith(
338-
'testuser',
339-
);
340-
341-
expect((authService as any).verifyAndGetUser).toHaveBeenCalledWith({
342-
username: 'testuser',
343-
344-
profileImage:
345-
'https://cdn.discordapp.com/avatars/discord-user-id/avatar-hash.png',
346-
});
347-
348-
expect(res.redirect).toHaveBeenCalledWith('/dashboard');
349-
});
350-
351261
it('should redirect to login if user is not whitelisted', async () => {
352262
const req: Partial<Request> = {
353263
user: {

server/src/config/EnvironmentVariables.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,8 @@ export class EnvironmentVariables {
9797
@IsString()
9898
DISCORD_WEBHOOK_URL: string;
9999

100-
// mailing
101100
@IsString()
102-
@IsNotEmpty()
103-
MAIL_TRANSPORT: string;
104-
105-
@IsString()
106-
@IsNotEmpty()
107-
MAIL_FROM: string;
101+
COOKIE_EXPIRES_IN: string;
108102
}
109103

110104
export function validate(config: Record<string, unknown>) {

server/src/song/song.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ import { SongService } from './song.service';
2525
SongUploadService,
2626
SongWebhookService,
2727
{
28+
inject: [ConfigService],
2829
provide: 'DISCORD_WEBHOOK_URL',
2930
useFactory: (configService: ConfigService) =>
3031
configService.getOrThrow('DISCORD_WEBHOOK_URL'),
31-
inject: [ConfigService],
3232
},
3333
],
3434
controllers: [SongController, MySongsController],

web/src/app/(content)/(info)/contact/contact.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Have you got any question, suggestion or feedback? We'd love to hear from you!
22

3-
To report an issue or suggest a new feature, please [open a new issue](https://github.com/issues/new/choose) in our GitHub repository. Make sure to search the existing issues to see if your suggestion has already been made. Also, check our [project roadmap](https://github.com/orgs/OpenNBS/projects/4) to see if the feature you want is already planned!
3+
To report an issue or suggest a new feature, please [open a new issue](https://github.com/OpenNBS/NoteBlockWorld/issues/new/choose) in our GitHub repository. Make sure to search the existing issues to see if your suggestion has already been made. Also, check our [project roadmap](https://github.com/orgs/OpenNBS/projects/4) to see if the feature you want is already planned!
44

55
For general support, or if you'd just like to have a chat, the fastest way to get in touch with us is by joining our public community on [Discord](https://discord.gg/note-block-world-608692895179997252). We're always happy to help!
66

0 commit comments

Comments
 (0)