mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-24 07:26:51 +03:00
1a50957950
When creating a new session, validate that it meets the following conditions: - must start with an alphabetical - can be composed of alphanumerics with hyphens - can be length 1 or longer - cannot begin or end with a hyphen
12 lines
311 B
TypeScript
12 lines
311 B
TypeScript
export const DEFAULT_SESSION = '';
|
|
|
|
/**
|
|
* Session ID validity:
|
|
*
|
|
* - must start with an alphabetical
|
|
* - can be composed of alphanumerics with hyphens
|
|
* - can be length 1 or longer
|
|
* - cannot begin or end with a hyphen
|
|
*/
|
|
export const SESSION_ID_REGEX = /(^[a-z]{1}[a-z\d\-]*[a-z\d]{1}$)|(^[a-z]{1}$)/;
|