Skip to content

Commit

Permalink
[MIG] auth_oauth_autologin: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Loregs2 committed Jun 11, 2024
1 parent 698d53d commit db20dff
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 27 deletions.
8 changes: 4 additions & 4 deletions auth_oauth_autologin/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
"name": "Auth Oauth Autologin",
"summary": """
Automatically redirect to the OAuth provider for login""",
"version": "16.0.1.0.0",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
"maintainers": ["sbidoul"],
"website": "https://github.com/OCA/server-auth",
"depends": ["auth_oauth"],
"data": ["views/auth_oauth_provider.xml"],
"demo": [],
"assets": {
"web.assets_frontend": ["auth_oauth_autologin/static/src/js/web_login.js"]
},
# "assets": {
# "web.assets_frontend": ["auth_oauth_autologin/static/src/js/web_login.js"]
# },
}
44 changes: 21 additions & 23 deletions auth_oauth_autologin/static/src/js/web_login.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
odoo.define("auth_oauth_autologin.redirect", function (require) {
"use strict";
/** @odoo-module */

const publicWidget = require("web.public.widget");
import publicWidget from "@web/legacy/js/public/public_widget";

publicWidget.registry.login.include({
selector: ".oe_login_form",
publicWidget.registry.login = publicWidget.Widget.extend({
selector: ".oe_login_form",

start: function () {
const def = this._super.apply(this, arguments);
let url = window.location.href;
if (url.includes("/web/login")) {
url = url.replace("/web/login", "/web");
start: function () {
const def = this._super.apply(this, arguments);
let url = window.location.href;
if (url.includes("/web/login")) {
url = url.replace("/web/login", "/web");
}
this._rpc({
route: "/auth/auto_login_redirect_link",
params: {
redirect: url,
},
}).then(function (result) {
if (result) {
window.location = result;
}
this._rpc({
route: "/auth/auto_login_redirect_link",
params: {
redirect: url,
},
}).then(function (result) {
if (result) {
window.location = result;
}
});
return def;
},
});
});
return def;
},
});

0 comments on commit db20dff

Please sign in to comment.