Initial LinkedSign platform
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import * as FileSystem from 'expo-file-system';
|
||||
import * as Sharing from 'expo-sharing';
|
||||
|
||||
export const downloadAndShareFile = async ({ url, token, filename }) => {
|
||||
const targetUri = `${FileSystem.cacheDirectory}${filename}`;
|
||||
const result = await FileSystem.downloadAsync(url, targetUri, {
|
||||
headers: {
|
||||
Authorization: `Bearer ${token}`,
|
||||
},
|
||||
});
|
||||
|
||||
if (await Sharing.isAvailableAsync()) {
|
||||
await Sharing.shareAsync(result.uri);
|
||||
}
|
||||
|
||||
return result.uri;
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
export const getPasswordChecks = (password = '') => ([
|
||||
{ key: 'length', label: 'Al menos 8 caracteres', valid: password.length >= 8 },
|
||||
{ key: 'upper', label: 'Una mayúscula', valid: /[A-Z]/.test(password) },
|
||||
{ key: 'lower', label: 'Una minúscula', valid: /[a-z]/.test(password) },
|
||||
{ key: 'number', label: 'Un número', valid: /\d/.test(password) },
|
||||
{ key: 'special', label: 'Un carácter especial', valid: /[^A-Za-z0-9]/.test(password) },
|
||||
]);
|
||||
|
||||
export const isPasswordStrong = (password = '') =>
|
||||
getPasswordChecks(password).every((rule) => rule.valid);
|
||||
Reference in New Issue
Block a user