feat(irc): add with network password (#639)

* feat(irc): initial add with network password

* feat(irc): check irc auth obj exists
This commit is contained in:
ze0s 2023-01-09 20:49:44 +01:00 committed by GitHub
parent 5c402b6d6c
commit 9e8672fdfe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 11 deletions

View file

@ -29,18 +29,17 @@ irc:
announcers:
- BOT
settings:
- name: nick
type: text
required: false
required: true
label: Username
help: Profile > Settings > External Chat Tokens > Add Device Token.
- name: auth.password
- name: pass
type: secret
required: false
label: NickServ Password
help: NickServ password
required: true
label: Token
help: Profile > Settings > External Chat Tokens > Token.
parse:
type: single

View file

@ -292,7 +292,7 @@ export function IndexerAddForm({ isOpen, toggle }: AddProps) {
const network: IrcNetworkCreate = {
name: ind.irc.network,
pass: "",
pass: formData.irc.pass || "",
enabled: false,
connected: false,
server: ind.irc.server,
@ -308,11 +308,13 @@ export function IndexerAddForm({ isOpen, toggle }: AddProps) {
channels: channels
};
if (formData.irc.auth) {
if (formData.irc.auth.account !== "" && formData.irc.auth.password !== "") {
network.auth.mechanism = "SASL_PLAIN";
network.auth.account = formData.irc.auth.account;
network.auth.password = formData.irc.auth.password;
}
}
mutation.mutate(formData as Indexer, {
onSuccess: () => {