diff --git a/src/auth/auth.controller.ts b/src/auth/auth.controller.ts index 6e4e98c..9c44edf 100644 --- a/src/auth/auth.controller.ts +++ b/src/auth/auth.controller.ts @@ -480,6 +480,20 @@ export class AuthController { ); console.log('google controller', user); this.jwtTokenService.setAuthCookies(res, accessToken); + const userAgent = req.headers['user-agent'] || ''; + const isFlutter = userAgent.includes('Flutter'); + + if (isFlutter) { + return res.send(` + +
+You can now close this window and return to the app.
+ + + `); + } + const html = ` @@ -540,6 +554,20 @@ export class AuthController { const { accessToken, ...user } = await this.authService.login(req.user.sub, req.user.username); this.jwtTokenService.setAuthCookies(res, accessToken); console.log('github controller', user); + + const userAgent = req.headers['user-agent'] || ''; + const isFlutter = userAgent.includes('Flutter'); + if (isFlutter) { + return res.send(` + + +You can now close this window and return to the app.
+ + + `); + } + const html = `