mirror of
https://github.com/pocketbase/pocketbase.git
synced 2025-04-14 13:01:54 +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 `meta.isNew` to the OAuth2 auth JSON response to indicate newly created PocketBase user.
|
||||
|
||||
|
||||
## v0.15.3
|
||||
|
||||
|
@ -242,7 +242,15 @@ func (api *recordAuthApi) authWithOAuth2(c echo.Context) error {
|
||||
e.Record = data.Record
|
||||
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