mirror of
https://github.com/pocketbase/pocketbase.git
synced 2025-04-25 16:54:35 +02:00
added meta.isNew to the json OAuth2 auth response
This commit is contained in:
parent
d36a044dc7
commit
6d0303deaf
@ -45,6 +45,8 @@
|
|||||||
|
|
||||||
- Added support for multiple relations sort in the Admin UI.
|
- Added support for multiple relations sort in the Admin UI.
|
||||||
|
|
||||||
|
- Added `meta.isNew` to the OAuth2 auth JSON response to indicate newly created PocketBase user.
|
||||||
|
|
||||||
|
|
||||||
## v0.15.3
|
## v0.15.3
|
||||||
|
|
||||||
|
@ -242,7 +242,15 @@ func (api *recordAuthApi) authWithOAuth2(c echo.Context) error {
|
|||||||
e.Record = data.Record
|
e.Record = data.Record
|
||||||
e.OAuth2User = data.OAuth2User
|
e.OAuth2User = data.OAuth2User
|
||||||
|
|
||||||
return RecordAuthResponse(api.app, e.HttpContext, e.Record, e.OAuth2User)
|
meta := struct {
|
||||||
|
*auth.AuthUser
|
||||||
|
IsNew bool `json:"isNew"`
|
||||||
|
}{
|
||||||
|
AuthUser: e.OAuth2User,
|
||||||
|
IsNew: event.IsNewRecord,
|
||||||
|
}
|
||||||
|
|
||||||
|
return RecordAuthResponse(api.app, e.HttpContext, e.Record, meta)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user