2024-12-31 10:30:14 +05:30
|
|
|
import Dialog from '~/components/Dialog';
|
2025-04-06 15:41:03 -04:00
|
|
|
import type { PreAuthKey, User } from '~/types';
|
2024-10-11 03:02:33 -04:00
|
|
|
|
2025-04-06 13:44:09 -04:00
|
|
|
interface ExpireAuthKeyProps {
|
2024-12-31 10:30:14 +05:30
|
|
|
authKey: PreAuthKey;
|
2025-04-06 15:41:03 -04:00
|
|
|
user: User;
|
2024-10-11 03:02:33 -04:00
|
|
|
}
|
|
|
|
|
|
2025-04-06 15:41:03 -04:00
|
|
|
export default function ExpireAuthKey({ authKey, user }: ExpireAuthKeyProps) {
|
2024-10-11 03:02:33 -04:00
|
|
|
return (
|
|
|
|
|
<Dialog>
|
2025-04-06 15:41:03 -04:00
|
|
|
<Dialog.Button variant="heavy">Expire Key</Dialog.Button>
|
|
|
|
|
<Dialog.Panel variant="destructive">
|
2025-01-26 15:04:13 -05:00
|
|
|
<Dialog.Title>Expire auth key?</Dialog.Title>
|
2025-04-06 15:41:03 -04:00
|
|
|
<input type="hidden" name="action_id" value="expire_preauthkey" />
|
2025-05-18 11:34:09 -04:00
|
|
|
<input type="hidden" name="user_id" value={user.id} />
|
2025-01-26 15:04:13 -05:00
|
|
|
<input type="hidden" name="key" value={authKey.key} />
|
|
|
|
|
<Dialog.Text>
|
|
|
|
|
Expiring this authentication key will immediately prevent it from
|
|
|
|
|
being used to authenticate new devices. This action cannot be undone.
|
|
|
|
|
</Dialog.Text>
|
2024-10-11 03:02:33 -04:00
|
|
|
</Dialog.Panel>
|
|
|
|
|
</Dialog>
|
2024-12-31 10:30:14 +05:30
|
|
|
);
|
2024-10-11 03:02:33 -04:00
|
|
|
}
|