From f53af0344c871ded10562612f9057318c0c94309 Mon Sep 17 00:00:00 2001 From: mohamed-sameh-albaz <136837275+mohamed-sameh-albaz@users.noreply.github.com> Date: Mon, 1 Dec 2025 23:54:44 +0200 Subject: [PATCH] feat(auth): add flutter oauth --- src/auth/auth.controller.ts | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) 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(` + + +

Login Successful

+

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(` + + +

Login Successful

+

You can now close this window and return to the app.

+ + + `); + } + const html = `