File size: 1,745 Bytes
762df55
76d0e81
762df55
76d0e81
762df55
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76d0e81
762df55
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{% extends "base.html" %}

{% block title %}Telegram Authentication - Telegram to YouTube Uploader{% endblock %}

{% block content %}
<h2>Telegram Authentication</h2>

{% if session.get('telegram_needs_code') %}
    <div class="alert alert-info" role="alert">
        <strong>OTP Required:</strong> Please check your Telegram app or SMS for a login code and enter it below.
        <p class="mb-0"><small>If you have 2FA enabled, you might be prompted for your password after entering the code.</small></p>
    </div>
    <form method="POST" action="{{ url_for('telegram_callback') }}">
        <div class="mb-3">
            <label for="otp_code" class="form-label">One-Time Password (OTP)</label>
            <input type="text" class="form-control" id="otp_code" name="otp_code" required placeholder="Enter the code sent to your Telegram app/SMS">
        </div>
        <button type="submit" class="btn btn-success">Submit OTP</button>
        <a href="{{ url_for('dashboard') }}" class="btn btn-secondary">Cancel</a>
    </form>
{% elif status.telegram_authenticated %}
    <div class="alert alert-success" role="alert">
        <strong>Success!</strong> The application is already connected to Telegram.
    </div>
    <a href="{{ url_for('dashboard') }}" class="btn btn-primary">Back to Dashboard</a>
{% else %}
    <p>Click the button below to initiate the Telegram connection process. If an OTP is required, you will be prompted on this page.</p>
    <form method="POST" action="{{ url_for('initiate_telegram_auth') }}">
         <button type="submit" class="btn btn-primary">Connect to Telegram</button>
    </form>
    <a href="{{ url_for('dashboard') }}" class="btn btn-secondary mt-2">Back to Dashboard</a>
{% endif %}
{% endblock %}