Skip to content

Commit f0f61e1

Browse files
committed
spelling mistakes
1 parent bd4f369 commit f0f61e1

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,5 @@ htmlcov/
2727
# Dev
2828
app.py
2929
config.py
30+
static/*
31+
flask_oneid/views.py

LICENCE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Grey Li
3+
Copyright (c) 2020 Odya
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

flask_oneid/__init__.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@
88

99
import json, requests
1010
from flask import Blueprint, request, redirect, jsonify, url_for, session
11-
from .exeptions import Flask_ONEID_Exception
11+
from .exceptions import Flask_ONEID_Exception
1212
class OneID:
13-
__oneid_url__ = "https://sso.egov.uz/sso/oauth/Authorization.do"
14-
__callbakc_url__ = "/"
15-
__one_id_keys = []
13+
1614
ONEID_LOGIN_URL = "/oneid/login"
1715
def __init__(self, app=None):
1816
if app is not None:
@@ -29,6 +27,9 @@ def init_app(self, app) -> None:
2927
3028
3129
"""
30+
self.__oneid_url__ = "https://sso.egov.uz/sso/oauth/Authorization.do"
31+
self.__callback_url = "/"
32+
self.__one_id_keys = []
3233
self.__client_id__ = app.config.get('ONEID_LOGIN')
3334
if self.__client_id__ is None:
3435
raise Flask_ONEID_Exception("ONEID_LOGIN is not set, please set it in config.py")
@@ -53,10 +54,9 @@ def get_user_data():
5354
elif type(value) == list:
5455
for item in value:
5556
params += key + "=" + item + "&"
56-
return redirect(self.__callbakc_url__+params)
57+
return redirect(self.__callback_url+params)
5758
@oneid.route('/auth', methods=['GET'])
5859
def oneid_auth():
59-
#return jsonify(request.args)
6060
code = request.args.get('code')
6161
self.__oneid_authorize__ = self.__oneid_url__ + "?grant_type=one_authorization_code&client_id=%s&client_secret=%s&redirect_uri=%s&code=%s"%(self.__client_id__,self.__client_secret__,self.__redirect__,code)
6262
x = requests.post(self.__oneid_authorize__)
@@ -90,6 +90,10 @@ def Set_Callback(self, callback_url):
9090
Args:
9191
callback_url (string): Callback url for redirect with data from OneID
9292
"""
93-
self.__callbakc_url__ = callback_url
93+
self.__callback_url = callback_url
94+
@property
95+
def oneid_login(self):
96+
return self.ONEID_LOGIN_URL
97+
9498

9599

0 commit comments

Comments
 (0)