from django.urls import path, re_path

from . import views
import Auth.views
from Auth.views import ProfileRoleView, ProfileRoleSimpleView, ProfileSimpleView, ProfileView, SessionView, LoginView, RefreshJWTView, SubscribeView, NewPasswordView, ResetPasswordView

urlpatterns = [
    re_path(r'^csrf$', Auth.views.csrf, name='csrf'),

    re_path(r'^login$', LoginView.as_view(), name="login"),
    re_path(r'^refreshJWT$', RefreshJWTView.as_view(), name="refresh_jwt"),
    re_path(r'^subscribe$', SubscribeView.as_view(), name='subscribe'),
    re_path(r'^newPassword$', NewPasswordView.as_view(), name='newPassword'),
    re_path(r'^resetPassword/(?P<code>[a-zA-Z]+)$', ResetPasswordView.as_view(), name='resetPassword'),
    re_path(r'^infoSession$', SessionView.as_view(), name='infoSession'),

    re_path(r'^profiles$', ProfileView.as_view(), name="profile"),
    re_path(r'^profiles/(?P<id>[0-9]+)$', ProfileSimpleView.as_view(), name="profile"),

    re_path(r'^profileRoles$', ProfileRoleView.as_view(), name="profileRoles"),
    re_path(r'^profileRoles/(?P<id>[0-9]+)$', ProfileRoleSimpleView.as_view(), name="profileRoles"),
]