Skip to content
Snippets Groups Projects
Commit 9faf086f authored by Lukas Haase's avatar Lukas Haase
Browse files

only allow certain characters for custom shortid on input

parent 6b8009e3
Branches
Tags
No related merge requests found
......@@ -26,7 +26,7 @@
<mat-form-field *ngIf="hasCustomShortId">
<input (focus)="eventService.makeFocusOnInputTrue()"
(blur)="eventService.makeFocusOnInputFalse()"
(keypress)="resetEmptyInputs()"
(keyup)="resetInvalidCharacters()"
matInput
#customShortId
class="input-block"
......
......@@ -48,6 +48,12 @@ export class RoomCreateComponent implements OnInit {
this.emptyInputs = false;
}
resetInvalidCharacters(): void {
if (this.customShortIdName) {
this.customShortIdName = this.customShortIdName.replace(/[^a-zA-Z0-9\_\-\*\~]+/gi, '');
}
}
checkLogin(longRoomName: string) {
if (!this.user) {
this.authenticationService.guestLogin(UserRole.CREATOR).subscribe(() => {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment