Update oidc to return refresh token in response body for mobile

This commit is contained in:
advplyr 2025-07-07 09:16:07 -05:00
parent 97afd22f81
commit d9cfcc86e7

View File

@ -399,10 +399,11 @@ class Auth {
*/
async handleLoginSuccessBasedOnCookie(req, res) {
// Handle token generation and get userResponse object
// TODO: where to check if refresh tokens should be returned?
const userResponse = await this.handleLoginSuccess(req, res, false)
// For API based auth (e.g. mobile), we will return the refresh token in the response
const isApiBased = this.isAuthMethodAPIBased(req.cookies.auth_method)
const userResponse = await this.handleLoginSuccess(req, res, isApiBased)
if (this.isAuthMethodAPIBased(req.cookies.auth_method)) {
if (isApiBased) {
// REST request - send data
res.json(userResponse)
} else {