mirror of
https://github.com/astuto/astuto.git
synced 2025-12-16 03:37:56 +01:00
Add OAuth2 authentication (#147)
- Added Site settings > Authentication section - Create/edit/delete your custom oauth2 configurations - Login or signup with oauth2
This commit is contained in:
committed by
GitHub
parent
3bda6dee08
commit
4c73b398e8
20
app/javascript/helpers/formUtils.ts
Normal file
20
app/javascript/helpers/formUtils.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { FieldError } from "react-hook-form";
|
||||
import I18n from 'i18n-js';
|
||||
|
||||
export const getLabel = (
|
||||
entity: string,
|
||||
attribute: string,
|
||||
) => (
|
||||
I18n.t(`activerecord.attributes.${entity}.${attribute}`)
|
||||
);
|
||||
|
||||
export const getValidationMessage = (
|
||||
validationType: FieldError['type'],
|
||||
entity: string,
|
||||
attribute: string,
|
||||
) => (
|
||||
I18n.t(
|
||||
`common.validations.${validationType}`,
|
||||
{ attribute: getLabel(entity, attribute) }
|
||||
)
|
||||
);
|
||||
Reference in New Issue
Block a user