2814 timebox create a poc to test the gmail api (#2868)
* create gmail strategy and controller
* gmail button connect
* wip
* trying to fix error { error: 'invalid_grant', error_description: 'Bad Request' }
* access token working
* refresh token working
* Getting the short term token from the front is working
* working
* rename token
* remove comment
* rename env var
* move file
* Fix
* Fix
---------
Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -69,8 +69,9 @@ export class JwtAuthStrategy extends PassportStrategy(Strategy, 'jwt') {
|
||||
let user;
|
||||
|
||||
if (payload.workspaceId) {
|
||||
user = await this.userRepository.findOneBy({
|
||||
id: payload.sub,
|
||||
user = await this.userRepository.findOne({
|
||||
where: { id: payload.sub },
|
||||
relations: ['defaultWorkspace'],
|
||||
});
|
||||
if (!user) {
|
||||
throw new UnauthorizedException();
|
||||
|
||||
Reference in New Issue
Block a user