mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-14 20:08:02 +00:00
18f761d404
Revert "fix: REVERT register Passkey API v2"
17 lines
370 B
Go
17 lines
370 B
Go
package authz
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/zitadel/zitadel/internal/errors"
|
|
)
|
|
|
|
// UserIDInCTX checks if the userID
|
|
// equals the authenticated user in the context.
|
|
func UserIDInCTX(ctx context.Context, userID string) error {
|
|
if GetCtxData(ctx).UserID != userID {
|
|
return errors.ThrowUnauthenticated(nil, "AUTH-Bohd2", "Errors.User.UserIDWrong")
|
|
}
|
|
return nil
|
|
}
|