mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	fix: reset-token-service should use unleashUrl
This commit is contained in:
		
							parent
							
								
									5565dd8c4b
								
							
						
					
					
						commit
						0086580130
					
				| @ -36,7 +36,7 @@ export default class ResetTokenService { | ||||
|     ) { | ||||
|         this.store = stores.resetTokenStore; | ||||
|         this.logger = getLogger('/services/reset-token-service.ts'); | ||||
|         this.unleashBase = new URL(server.baseUriPath, server.unleashUrl); | ||||
|         this.unleashBase = new URL(server.unleashUrl); | ||||
|     } | ||||
| 
 | ||||
|     async useAccessToken(token: IResetQuery): Promise<boolean> { | ||||
| @ -100,12 +100,12 @@ export default class ResetTokenService { | ||||
|         forUser: number, | ||||
|         creator: string, | ||||
|     ): Promise<URL> { | ||||
|         const path = '/#/reset-password'; | ||||
|         const path = '/reset-password'; | ||||
|         return this.createResetUrl(forUser, creator, path); | ||||
|     } | ||||
| 
 | ||||
|     async createNewUserUrl(forUser: number, creator: string): Promise<URL> { | ||||
|         const path = '/#/new-user'; | ||||
|         const path = '/new-user'; | ||||
|         return this.createResetUrl(forUser, creator, path); | ||||
|     } | ||||
| 
 | ||||
|  | ||||
| @ -59,7 +59,10 @@ test.serial('Should create a reset link', async t => { | ||||
|         adminUser, | ||||
|     ); | ||||
| 
 | ||||
|     t.true(url.toString().indexOf('/reset-password') > 0); | ||||
|     t.is( | ||||
|         url.toString().substring(0, url.toString().indexOf('=')), | ||||
|         `${config.server.unleashUrl}/reset-password?token`, | ||||
|     ); | ||||
| }); | ||||
| 
 | ||||
| test.serial('Should create a welcome link', async t => { | ||||
| @ -67,7 +70,11 @@ test.serial('Should create a welcome link', async t => { | ||||
|         userIdToCreateResetFor, | ||||
|         adminUser.username, | ||||
|     ); | ||||
|     t.true(url.toString().indexOf('/new-user') > 0); | ||||
|     const urlS = url.toString(); | ||||
|     t.is( | ||||
|         urlS.substring(0, urlS.indexOf('=')), | ||||
|         `${config.server.unleashUrl}/new-user?token`, | ||||
|     ); | ||||
| }); | ||||
| 
 | ||||
| test.serial('Tokens should be one-time only', async t => { | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user